4.加入到开机自动运行
vi /etc/rc.d/rc.local
ifenslave bond0 eth0 eth1
route add -net 192.168.1.254 netmask 255.255.255.0 bond0
重启系统后能看到3块网卡,其中bond0的流量是eth0+eth1的总和。
查看bond0虚拟网卡
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.1.2 (January 20, 2007)
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: 0
Permanent HW addr: 00:1e:4d:24:ec:49
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:1e:4d:24:ed:4b
5.试验验证
用外部同一网段的一台机器做ping试验,双网卡机器上手工拔掉其中任意一条网络线(或者使用ifup eth0&&ifdown eth1),ping机器的终端应该没有中断信息,或者有一个”timeout”后很快恢复,则证明试验成功。