- 浏览: 960778 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
孤星119:
好熟悉的数据库字段啊, 上家公司做的项目每天都跟这些字段打招呼 ...
Oracle exp compress参数引起的空间浪费 -
itspace:
quxiaoyong 写道遇到个问题,网上一搜,全他妈这篇文章 ...
数据库连接错误ORA-28547 -
quxiaoyong:
遇到个问题,网上一搜,全他妈这篇文章。你转来转去的有意思吗?
数据库连接错误ORA-28547 -
hctech:
关于version count过高的问题,不知博主是否看过ey ...
某客户数据库性能诊断报告 -
itspace:
invalid 写道写的不错,我根据这个来安装,有点理解错误了 ...
AIX 配置vncserver
理论不赘述,简而言之,网卡绑定就是多张网卡逻辑上作为一张网卡用。可分为,负载均衡绑定和冗余绑定两种。以下为操作过程:
linux的内核为
查看网卡绑定之前的状态
1、编辑虚拟网络接口配置文件
2、编辑各网卡的配置文件,注意编辑之前做好备份工作
3、修改/etc/modprobe.conf 文件,同样做好备份,最后加入2行
alias bond0 bonding
options bond0 miimon=100 mode=0
注:
(1)、miimon 是链路监测的时间间隔单位是毫秒,miimon=100的意思就是,每100毫秒检测网卡和交换机之间是否连通,如不通则使用另外的链路。
(2)、mode=0 表示负载均衡方式,两块网卡都工作,需要交换机作支持
mode=1 表示冗余方式,网卡只有一个工作,一个出问题启用另外的
mode=6 表示负载均衡方式,两块网卡都工作,不需要交换机作支持
[root@test ~]# more /etc/modprobe.conf
alias eth0 b44
alias eth1 8139too
alias usb-controller ehci-hcd
alias usb-controller1 ohci-hcd
alias bond0 bonding
options bond0 miimon=100 mode=0
4、在/etc/rc.d/rc.local 加入如下一行
ifenslave bond0 eth0 eth1
[root@test ~]# more /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
ifenslave bond0 eth0 eth1
5、重新启动后负载平衡已经能正常工作,service network restart,经测试,不行
6、查看bond0的工作状态
7、查看经过绑定后的网卡工作情况
附:
DEVICE=物理设备名
IPADDR=IP地址
NETMASK=掩码值
NETWORK=网络地址
BROADCAST=广播地址
GATEWAY=网关地址
ONBOOT=[yes|no](引导时是否激活设备)
USERCTL=[yes|no](非root用户是否可以控制该设备)
BOOTPROTO=[none|static|bootp|dhcp](引导时不使用协议|静态分配|BOOTP协议|DHCP协议)
HWADDR = 你的MAC地址
6模式对网卡有要求的
是?
6模式对网卡有要求的
linux的内核为
引用
[root@test ~]# uname -a
Linux test 2.6.9-22.EL #1 Mon Sep 19 18:20:28 EDT 2005 i686 i686 i386 GNU/Linux
Linux test 2.6.9-22.EL #1 Mon Sep 19 18:20:28 EDT 2005 i686 i686 i386 GNU/Linux
查看网卡绑定之前的状态
引用
[root@test network-scripts]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet addr:172.16.4.100 Bcast:172.16.4.255 Mask:255.255.255.0
inet6 addr: fe80::21b:b9ff:fe58:8bb2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6843321 errors:0 dropped:0 overruns:0 frame:0
TX packets:8409339 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4047128168 (3.7 GiB) TX bytes:572617584 (546.0 MiB)
Interrupt:9
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:18929827 errors:0 dropped:0 overruns:0 frame:0
TX packets:18929827 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2431050637 (2.2 GiB) TX bytes:2431050637 (2.2 GiB)
eth0 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet addr:172.16.4.100 Bcast:172.16.4.255 Mask:255.255.255.0
inet6 addr: fe80::21b:b9ff:fe58:8bb2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6843321 errors:0 dropped:0 overruns:0 frame:0
TX packets:8409339 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4047128168 (3.7 GiB) TX bytes:572617584 (546.0 MiB)
Interrupt:9
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:18929827 errors:0 dropped:0 overruns:0 frame:0
TX packets:18929827 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2431050637 (2.2 GiB) TX bytes:2431050637 (2.2 GiB)
1、编辑虚拟网络接口配置文件
引用
[root@test ~]# more /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=172.16.4.100
NETMASK=255.255.255.0
BROADCAST=172.16.4.255
NETWORK=172.168.4.100
ONBOOT=yes
DEVICE=bond0
IPADDR=172.16.4.100
NETMASK=255.255.255.0
BROADCAST=172.16.4.255
NETWORK=172.168.4.100
ONBOOT=yes
2、编辑各网卡的配置文件,注意编辑之前做好备份工作
引用
[root@test ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
slave=yes
[root@test ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
slave=yes
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
slave=yes
[root@test ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
slave=yes
3、修改/etc/modprobe.conf 文件,同样做好备份,最后加入2行
alias bond0 bonding
options bond0 miimon=100 mode=0
注:
(1)、miimon 是链路监测的时间间隔单位是毫秒,miimon=100的意思就是,每100毫秒检测网卡和交换机之间是否连通,如不通则使用另外的链路。
(2)、mode=0 表示负载均衡方式,两块网卡都工作,需要交换机作支持
mode=1 表示冗余方式,网卡只有一个工作,一个出问题启用另外的
mode=6 表示负载均衡方式,两块网卡都工作,不需要交换机作支持
引用
[root@test ~]# more /etc/modprobe.conf
alias eth0 b44
alias eth1 8139too
alias usb-controller ehci-hcd
alias usb-controller1 ohci-hcd
alias bond0 bonding
options bond0 miimon=100 mode=0
4、在/etc/rc.d/rc.local 加入如下一行
ifenslave bond0 eth0 eth1
引用
[root@test ~]# more /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
ifenslave bond0 eth0 eth1
5、重新启动后负载平衡已经能正常工作,service network restart,经测试,不行
6、查看bond0的工作状态
引用
[root@test ~]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v2.6.1 (October 29, 2004)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 1
Permanent HW addr: 00:1b:b9:58:8b:b2
Slave Interface: eth1
MII Status: down
Link Failure Count: 0
Permanent HW addr: 00:07:40:6c:ac:c8
Ethernet Channel Bonding Driver: v2.6.1 (October 29, 2004)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 1
Permanent HW addr: 00:1b:b9:58:8b:b2
Slave Interface: eth1
MII Status: down
Link Failure Count: 0
Permanent HW addr: 00:07:40:6c:ac:c8
7、查看经过绑定后的网卡工作情况
引用
[root@test ~]# ifconfig -a
bond0 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet addr:172.16.4.100 Bcast:172.16.4.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:744154 errors:0 dropped:0 overruns:0 frame:0
TX packets:1866915 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1099876146 (1.0 GiB) TX bytes:121233595 (115.6 MiB)
eth0 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet6 addr: fe80::21b:b9ff:fe58:8bb2/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:744154 errors:0 dropped:0 overruns:0 frame:0
TX packets:1866905 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1099876146 (1.0 GiB) TX bytes:121232839 (115.6 MiB)
Interrupt:9
eth1 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet6 addr: fe80::21b:b9ff:fe58:8bb2/64 Scope:Link
UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:756 (756.0 b)
Interrupt:11 Base address:0x1000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2129 errors:0 dropped:0 overruns:0 frame:0
TX packets:2129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1998893 (1.9 MiB) TX bytes:1998893 (1.9 MiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
bond0 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet addr:172.16.4.100 Bcast:172.16.4.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:744154 errors:0 dropped:0 overruns:0 frame:0
TX packets:1866915 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1099876146 (1.0 GiB) TX bytes:121233595 (115.6 MiB)
eth0 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet6 addr: fe80::21b:b9ff:fe58:8bb2/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:744154 errors:0 dropped:0 overruns:0 frame:0
TX packets:1866905 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1099876146 (1.0 GiB) TX bytes:121232839 (115.6 MiB)
Interrupt:9
eth1 Link encap:Ethernet HWaddr 00:1B:B9:58:8B:B2
inet6 addr: fe80::21b:b9ff:fe58:8bb2/64 Scope:Link
UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:756 (756.0 b)
Interrupt:11 Base address:0x1000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2129 errors:0 dropped:0 overruns:0 frame:0
TX packets:2129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1998893 (1.9 MiB) TX bytes:1998893 (1.9 MiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
附:
DEVICE=物理设备名
IPADDR=IP地址
NETMASK=掩码值
NETWORK=网络地址
BROADCAST=广播地址
GATEWAY=网关地址
ONBOOT=[yes|no](引导时是否激活设备)
USERCTL=[yes|no](非root用户是否可以控制该设备)
BOOTPROTO=[none|static|bootp|dhcp](引导时不使用协议|静态分配|BOOTP协议|DHCP协议)
HWADDR = 你的MAC地址
评论
3 楼
Magicloud
2009-08-20
itspace 写道
Magicloud 写道
現在更傾向于使用6模式……
另外個人喜歡使用toe網卡……
另外個人喜歡使用toe網卡……
6模式对网卡有要求的
是?
2 楼
itspace
2009-08-19
Magicloud 写道
現在更傾向于使用6模式……
另外個人喜歡使用toe網卡……
另外個人喜歡使用toe網卡……
6模式对网卡有要求的
1 楼
Magicloud
2009-08-19
現在更傾向于使用6模式……
另外個人喜歡使用toe網卡……
另外個人喜歡使用toe網卡……
发表评论
-
参加Oracle勒索病毒防范专题培训会议
2019-09-27 17:15 4242019年7月22日,受邀参加Oracle勒索病毒防范专题培训 ... -
selinux引起的ftp故障
2011-10-18 13:11 1452linux开通gssftp之后,客户端连接linux出现以下问 ... -
vmware 网卡hostonly模式不能ping的问题
2010-12-01 11:58 2196因测试需要,开启虚拟机,网卡为hostonly模式,启动之后不 ... -
linux 5 x64上安装基础软件的一些错误修复
2010-11-25 12:23 1779因项目需要,以下为linux as 5 上安装基础软件时一些错 ... -
linux gcc rpm包安装过程
2010-11-25 12:02 4160系统中发现gcc未安装,以下为gcc安装过程中的依赖包 引用[ ... -
linux lvm创建文件系统
2010-11-25 12:00 1682以下仅为安装记录 1、创建lv 引用[root@Linux ~ ... -
linux 5 裸设备绑定
2010-11-17 14:33 1601在以前的redhat版本中,系统通过/etc/sysconfi ... -
oci8
2010-09-10 17:30 1709[dbra@shenjp ruby-oci8-1.0.7]$ ... -
OCI安装错误记录(二)
2010-07-31 15:22 1827由于Oracle 11g R2 X64在windo ... -
OCI安装错误记录(一)
2010-07-28 09:36 5889主机环境: WINDOWS 2008 X64+ORACLE 1 ... -
sudo安装错误/usr/bin/ld: cannot find -lpam
2010-05-10 17:10 4314centos 5.1版本为 引用[root@rztest su ... -
linux dmidecode 查看硬件信息
2010-03-03 11:21 2164在linux平台可以利用命令dmidecode查看硬件信息,以 ... -
linux 修改时区
2009-12-24 14:46 3402一、修改时区 1、查看当前使用的时区,可以看到当前系统使用美 ... -
linux 划分文件系统
2009-12-24 09:58 1134linux版本为 引用[root@hzmc ~]# uname ... -
tar压缩使用方法
2009-12-10 16:47 2187为了方便用户在打包解包的同时可以压缩或解压文件,tar提供了一 ... -
linux 共享内存段研究
2009-12-09 14:11 5413无论是在unix或者是linux都有命令查看主机共享内存段的使 ... -
Linux显示网卡流量
2009-09-03 14:24 2210Linux操作系统版本为: 引用[root@hzmc tmp] ... -
linux 绑定模式分别为冗余和均衡负载时信息显示
2009-08-19 16:46 1253linux绑定网卡在《linux as 4 bond网卡绑定》 ... -
xinetd: unrecognized service
2009-08-17 10:21 13418linux xinetd 服务不能启动: [root@capa ... -
Linux RPM包简介
2009-08-16 15:56 2037安装rpm包十分便捷,省去了很多编译过程,但是很多情况下,我们 ...
相关推荐
linux双网卡bond绑定,实现主备,负载均衡
linux双网卡绑定 bonding
Linux os bond绑定网卡方法,双网口冗余
双网卡绑定操作
Linux系统双网卡绑定Python脚本,如果你的服务器太多,或者不想手动敲的话,这个脚本还是很适合你的,目前我只在centos和rhel系统上面测试过,完美通过。之前上传的那个有点问题。下载下去后,传到linux系统里面去,...
Linux双网卡绑定,RHEL6双网卡绑定
本文档教你如何在Linux下配置bond网卡,可选择多种bond网卡工作模式。
服务器双网卡绑定在linux的操作过程,里面比较详细的讲解了如何使服务器实现双网卡的冗余技术
网卡bond是通过多张网卡绑定为一个逻辑网卡,实现本地网卡的冗余,带宽扩容和负载均衡,在生产场景中是一种常用的技术。 适用场景 服务器两张网卡需要做bond,并且bond后网卡需配置不同网段的地址,用于走不同流量...
凝思Linux6.0.80操作系统双网卡绑定.zip
1.在/etc/sysconfig/network-scripts/下新建bond0文件 2.修改eth0和eth1真实网卡的配置文件 3.配置/etc/modprobe.conf 添加以下两行内容 4.配置/etc/rc.d/rc.local 加入以下内容
下载后吧后缀名改成py即可,仅仅实用与Linux系统,目前仅仅在rhel和centos两个类型里面进行过测试()。
linux bond和交换机的端口配置,并且在linux端口绑定时注意hash算法,不然网口bond后会出现负载均衡的问题,可能你需要两个1G变2G结果没有提升。
在centos linux7.5操作系统层面上利用bond技术构建双网卡绑定
Linux网卡绑定mode共有七种(0~6) bond0、bond1、bond2、bond3、bond4、bond5、bond6 常用的有三种 mode=0:平衡负载模式,有自动备援,但需要”Switch”支援及设定。 mode=1:自动备援模式,其中一条线若断线,其他...
windows server 2008 双网卡绑定,实现高速访问服务器
为了提供网络的高可用性,我们可能需要将多块网卡绑定成一块虚拟网卡对外提供服务,这样即使其中的一块物理网卡出现故障,也不会导致连接中断。比如我们能够将eth0和eth1绑定成虚拟网卡bond0
Bond网卡配置,负载均衡、链路汇聚,均可作为参考
环境:arm11 背景:公司的采集主机要实现双网卡的功能,开始两个网卡定义在不一样的网段上,可以独立使用,但要通过网关连接外网时发现...最后只有使用两个网卡绑定(bond)的方法,使用一个ip,这种方法才是最理想的。