標籤:bond rhel5
一、配置bond
1、ifcfg-bond0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.26.27
NETMASK=255.255.255.0
GATEWAY=10.0.26.1
2、ifcfg-eth1
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
3、ifcfg-eth2
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
4、/etc/modprobe.conf配置
alias eth0 pcnet32
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
alias eth1 pcnet32
alias eth2 pcnet32
alias bond0 bonding
options bonding millmon=100 mode=1
二、查看狀態
1、重啟網路
/etc/init.d/network restart
2、查看bond運行狀態
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 1
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:a2:4d:00
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:a2:4d:01
三、測試bond
1、斷開eth1網口
[[email protected] network-scripts]# ifdown eth1
2、查看bond狀態,eth1已經掉線,現在eth2接管
[[email protected] network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 1
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:a2:4d:01
3、啟用eth1
[[email protected] network-scripts]# ifup eth1
4、查看bond狀態,eth1上線,但是網路流量還是在eth2上跑,eth1作為備份。(之前eth1是承載流量)
[[email protected] network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 1
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth2
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:a2:4d:01
Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:50:56:a2:4d:00
本文出自 “lose” 部落格,請務必保留此出處http://blove.blog.51cto.com/3116850/1536064