使用bonding技术实现双网卡绑定
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-05-13
nding options bond0 mode=balance-alb miimon=100 Replace the sample parameters with the appropriate set of options for your configuration. Finally run "/etc/rc.d/init.d/network restart" as root. This will restart the networking subsystem and your bond link should be now up and running. 能看懂就照着做吧,看不懂的话照着我下面的例子也OK NETWORK=192.168.0.0 IPADDR=192.168.0.111 NETMASK=255.255.255.0 BROADCAST=192.168.0.255 ONBOOT=yes BOOTPROTO=none USERCTL=no vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none vi /etc/modprobe.conf 加入两行 alias bond0 bonding options bond0 miimon=100 mode=1 参数miimon是链路监测.miimon=100,表示系统每100ms监测一次链路连接状态,如果有一条线路不通就 转入另一条线路. 参数mode表示工作模式. mode=0表示load balancing两块网卡同时工作,提供负载均衡. mode=1表示fault-tolerance提供冗余功能,工作方式是主备的工作方式,提供高可用. 配置完毕后重启机器,启动过程中show details可以看到bonding启动成功. 4.察看bonding运行状态 [root@localhost /]# ifconfig bond0 Link encap:Ethernet HWaddr 00:1D:60:99:8C:EB inet addr:192.168.0.111 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:2805 errors:0 dropped:0 overruns:0 frame:0 TX packets:2006 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:281846 (275.2 KiB) TX bytes:481206 (469.9 KiB) eth0 Link encap:Ethernet HWaddr 00:1D:60:99:8C:EB UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:2302 errors:0 dropped:0 overruns:0 frame:0 TX packets:2014 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:234137 (228.6 KiB) TX bytes:482422 (471.1 KiB) Interrupt:17 Base address:0xd400 eth1 Link encap:Ethernet HWaddr 00:1D:60:99:8C:EB UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:506 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:47889 (46.7 KiB) TX bytes:0 (0.0 b) Interrupt:21 Base address:0x4c00 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:2640 errors:0 dropped:0 overruns:0 frame:0 TX packets:2640 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4668416 (4.4 MiB) TX bytes:4668416 (4.4 MiB) [root@localhost /]# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.1.3 (June 13, 2007) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Act |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: 易语言编写linux程序下一篇: 一些简单的linux习题(可做复习用)六
关于使用bonding技术实现双网卡绑定的所有评论