红联Linux门户
Linux帮助

Bonding in Linux

发布时间:2008-10-11 00:53:55来源:红联作者:Orelvsx
/etc/modprobe.conf
alias bond0 bonding
options bond0 miimon=100 mode=1

/etc/rc.d/rc.local
ifenslave bond0 eth0 eth1
route add -net 192.168.0.254 netmask 255.255.255.0 bond0

/etc/sysconfig/network-script/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.0.125
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
DNS1=192.168.0.1
PEERDNS=yes
DOMAIN=mycom.com.cn
GATEWAY=192.168.0.1

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

cd /etc/sysconfig/network-scripts/
ifdown ifcfg-eth0
ifup ifcfg-eth0
ifdown ifcfg-eth1
ifup ifcfg-eth1
ifup ifcfg-bond0


# mode=0 --> Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.
# mode=1 --> Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.
# mode=2 --> Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.
# mode=3 --> Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.
# mode=4 --> Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.
# mode=5 --> Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.
# mode=6 --> Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.
文章评论

共有 0 条评论