- filename: /lib/modules/2.6.25.19/kernel/drivers/net/bonding/bonding.ko
- DEVICE=eth0 //设备
- BOOTPROTO=dhcp //自动获取地址
- ONBOOT=yes //启动激活
- DEVICE=eth1
- BOOTPROTO=dhcp
- ONBOOT=yes
- DEVICE=bond0
- BOOTPROTO=none
- IPADDR=192.168.2.101
- NETMASK=255.255.255.0
- ONBOOT=yes
4.vim /etc/rc.local
- alias bond0 bonding //内核模块
- options bond0 miimon=100 //链路监测 mode=1 //工作模式
配置完毕,重新启动电脑
- ifenslave bond0 eth0 eth1
- Pinging 192.168.2.101 with 32 bytes of data:
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Ping statistics for 192.168.2.101:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 0ms, Maximum = 0ms, Average = 0ms
- bond0 Link encap:Ethernet HWaddr 00:0C:29:9E:49:28
- inet addr:192.168.2.101 Bcast:192.168.2.255 Mask:25
- 5.255.255.0
- inet6 addr: fe80::20c:29ff:fe9e:4928/64 Scope:Link
- UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
- RX packets:87 errors:0 dropped:0 overruns:0 frame:0
- TX packets:122 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:13696 (13.3 KiB) TX bytes:24910 (24.3 KiB)
- eth0 Link encap:Ethernet HWaddr 00:0C:29:9E:49:28
- UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
- RX packets:73 errors:0 dropped:0 overruns:0 frame:0
- TX packets:98 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:10395 (10.1 KiB) TX bytes:19299 (18.8 KiB)
- Interrupt:19 Base address:0x2000
- eth1 Link encap:Ethernet HWaddr 00:0C:29:9E:49:28
- UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
- RX packets:14 errors:0 dropped:0 overruns:0 frame:0
- TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:3301 (3.2 KiB) TX bytes:5611 (5.4 KiB)
断开网卡eth0后:
- Bonding Mode: fault-tolerance (active-backup)
- 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
- Link Failure Count: 0
- Permanent HW addr: 00:0c:29:9e:49:28
- Slave Interface: eth1
- MII Status: up
- Link Failure Count: 0
- Permanent HW addr: 00:0c:29:9e:49:32
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Request timed out.
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Bonding Mode: fault-tolerance (active-backup)
- Primary Slave: None
- Currently Active Slave: eth1
- MII Status: up
- MII Polling Interval (ms): 100
- Up Delay (ms): 0
- Down Delay (ms): 0
- Slave Interface: eth0
- MII Status: down
- Link Failure Count: 1
- Permanent HW addr: 00:0c:29:9e:49:28
- Slave Interface: eth1
- MII Status: up
- Link Failure Count: 0
- Permanent HW addr: 00:0c:29:9e:49:32
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Request timed out.
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- Reply from 192.168.2.101: bytes=32 time<1ms TTL=64
- options bond0 miimon=100 mode=0
本文出自 “1” 博客,转载请与作者联系!