www.602.net 5

修改新建网卡绑定bond0配置文件【www.602.net】

透过网口绑定(bond)才能,能够很轻便完结网口冗余,负载均衡,进而到达高可用负载均衡的目标。

[[email protected]
~]# cat /etc/issue
CentOS release 6.5 (Final)
修改新建网卡绑定bond0配置文件【www.602.net】。修改新建网卡绑定bond0配置文件【www.602.net】。Kernel \r on an \m

[[email protected]修改新建网卡绑定bond0配置文件【www.602.net】。
~]# echo “alias netdev-bond0 bonding” >/etc/modprobe.d/bonding.conf

网卡绑定前须求施行那些命令,以此来增加服务器运行时加载的模块。

修改新建网卡绑定bond0配置文件

[[修改新建网卡绑定bond0配置文件【www.602.net】。email protected]
~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0

www.602.net,DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
USERCTL=no
修改新建网卡绑定bond0配置文件【www.602.net】。PEERDNS=yes
IPV6INIT=no
IPADDR=112.25.xx.xx
NETMASK=255.255.255.192
BROADCAST=112.25.xx.xx
GATEWAY=112.25.xx.xx
BONDING_OPTS=”miimon=80 mode=6″

miimon
是链路监测的时光间隔单位是微秒,miimon=80的意趣正是每80ms监测壹遍链路连接意况,假使有一条线路短路就转入另一条线路。

mode=0 表示负载均衡情势,两块网卡都干活,必要调换机作支撑

mode=1 表示冗余格局,网卡独有一个办事,一个出难题启用其余的

mode=6 表示负载均衡格局,两块网卡都干活,不供给调换机作支撑

www.602.net 1

本人那边做的是多少个网卡的绑定,服务器是dell
哈弗720,其网卡暗许名为em1–em4,网卡绑定期候,两个网卡的计划基本相似,master须要拟定为bond0,多个网卡均为slave

www.602.net 2

 

www.602.net 3

 

重启服务器

接下来查看网卡绑定音讯

www.602.net 4

 

www.602.net 5

 

**[[email protected]
~]# ifconfig
bond0 Link encap:Ethernet HWaddr F8:BC:12:38:BF:04
inet addr:112.25.xx.17 Bcast:112.25.xx.63 Mask:255.255.255.192
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:198948 errors:0 dropped:0 overruns:0 frame:0
TX packets:374418 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20792024 (19.8 MiB) TX bytes:29577760 (28.2 MiB)

em1 Link encap:Ethernet HWaddr F8:BC:12:38:BF:04
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:36838 errors:0 dropped:0 overruns:0 frame:0
TX packets:123885 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3250190 (3.0 MiB) TX bytes:12842300 (12.2 MiB)
Interrupt:35

em2 Link encap:Ethernet HWaddr F8:BC:12:38:BF:05
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:88178 errors:0 dropped:0 overruns:0 frame:0
TX packets:87303 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11017650 (10.5 MiB) TX bytes:6243968 (5.9 MiB)
Interrupt:38

em3 Link encap:Ethernet HWaddr F8:BC:12:38:BF:06
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:37044 errors:0 dropped:0 overruns:0 frame:0
TX packets:81803 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3274966 (3.1 MiB) TX bytes:5272322 (5.0 MiB)
Interrupt:34

em4 Link encap:Ethernet HWaddr F8:BC:12:38:BF:07
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:36888 errors:0 dropped:0 overruns:0 frame:0
TX packets:81427 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3249218 (3.0 MiB) TX bytes:5219170 (4.9 MiB)
Interrupt:36

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:99 (99.0 b) TX bytes:99 (99.0 b)**

 

 

[[email protected]
~]# cat /etc/issue CentOS release 6….

发表评论

电子邮件地址不会被公开。 必填项已用*标注