環境
SUSE Linux Enterprise Server 11 sp4
Linux x86_64 x86_64 x86_64 GNU/Linuxlinux
配置(/etc/sysconfig/network)
ifcfg-eth0:服務器
DEVICE='eth0'
STARTMODE='auto'
BOOTPROTO='static'
MASTER='bond0'
SLAVE='yes'網絡
ifcfg-eth1:ide
DEVICE='eth1'
STARTMODE='auto'
BOOTPROTO='static'
MASTER='bond0'
SLAVE='yes'操作系統
ifcfg-bond0:rest
BONDING_MASTER='yes'
BONDING_MODULE_OPTS='mode=1 miimon=100 fail_over_mac=1'
BOOTPROTO='static'
IPADDR='168.192.10.100/24'
STARTMODE='auto'
USERCONTROL='no'
BONDING_SLAVE0='eth0'
BONDING_SLAVE1='eth1'code
#沒有ifcfg-bond0該文件時建立該文件,mode=1 熱備模式(active-backup),vmware workstation 11 個人不支持第一種獲取mac地址的方式,那麼你能夠使用fail_mac_over=1參數。固然了,在真實服務器環境中就能夠不用這麼作。
blog
修改bonding配置
vi /etc/modprobe.d/bonding.conf
alias bond0 bondingip
加載模塊到內核中it
modprobe bonding
service network restart
#insmod 通常是須要在必定規範的路徑,並且不會按依賴順序模塊加載,而modprobe,不一樣,它能夠在任意路徑下,自動把須要依賴模塊以及bonding加載到內核中。
查看bonding 狀態
`cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 00:0c:29:fb:3f:ab
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 00:0c:29:fb:3f:b5
Slave queue ID: 0``
bond0當前在使用的網卡是 eth0 **其它linux環境** 在Redhat6.5 相似操做,綁定雙網卡作熱備成功 ifcfg-bond0 DEVICE=bond0 TYPE=Ethernet ONBOOT=yes BOOTPROTO=static IPADDR=168.192.10.12 NETMASK=255.255.255.0 GATEWAY=168.192.10.1 USERCTL=no BONDING_OPTS="mode=1 miimon=200 fail_over_mac=1" ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet ONBOOT=yes BOOTPROTO=static USRCTL=no MASTER=bond0 SLAVE=yes ifcfg-eth1 DEVICE=eth1 TYPE=Ethernet ONBOOT=yes BOOTPROTO=static USRCTL=no MASTER=bond0 SLAVE=yes **注意:Redhat 6 bond 配置修改路徑** vi /etc/modprobe.d/dist.conf alias bond0 bonding 取消配置說明 刪除/etc/sysconfig/network-scripts/ifcfg-bond0文件, 恢復/etc/sysconfig/network-scripts/ifcfg-eth0和ifcfg-eth1網卡配置文件,刪 除/etc/modprobe.d/bonding.conf文件。 rmmod bonding (必定要作這一步) 重啓網絡服務,若是沒有刪除綁定網卡,就重啓操做系統。 service network restart reboot