linux下多网卡绑定.docx

上传人:夏** 文档编号:556051142 上传时间:2023-01-03 格式:DOCX 页数:5 大小:19.64KB
返回 下载 相关 举报
linux下多网卡绑定.docx_第1页
第1页 / 共5页
linux下多网卡绑定.docx_第2页
第2页 / 共5页
linux下多网卡绑定.docx_第3页
第3页 / 共5页
linux下多网卡绑定.docx_第4页
第4页 / 共5页
linux下多网卡绑定.docx_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《linux下多网卡绑定.docx》由会员分享,可在线阅读,更多相关《linux下多网卡绑定.docx(5页珍藏版)》请在金锄头文库上搜索。

1、linux下多网卡绑定假定将eth0,eth1,eth2,eth3绑定成bond0,步骤如下:(1)#vi /etc/modprobe.conf,添加如下2行: alias bond0 bonding options bonding miimon=100 mode=4当mode0时,交换机相应端口不需要做trunk,但是从节点上ping网关(192.*.*.*)有较大的延时。解决此问题的办法是把mode改成4,同时配置交换机相应端口开启链路聚合并捆绑为trunk。在modprobe.conf文件中,miimon参数用来监测网卡物理连接,建议至少设为100mode参数用来设置绑定模式0负载均衡(

2、round robin策略)1 active/backup模式,同一时间只有一块网卡使用。2负载均衡(xor算法)3广播模式4 802.3ad模式,lagp协议,带宽翻倍。模式不能写错这里很容易出现不稳定的情况,多半是这里模式选择错了,所以在实施的时候需要小心,把模式确定了,然后在动手。(2)修改/etc/sysconfig/network-scripts/目录下的ifcfg-bond0, ifcfg-eth0, ifcfg-eth1,ifcfg-eth2,ifcfg-eth3. 具体内容如下:rootio102 network-scripts# pwd/etc/sysconfig/netwo

3、rk-scriptsrootio102 network-scripts# cat ifcfg-bond0DEVICE=bond0BOOTPROTE=staticONBOOT=yesIPADDR=192.*.*.*NETMASK=255.255.255.0USERTCL=noGATEWAY=192.*.*.*rootio102 network-scripts# cat ifcfg-eth0DEVICE=eth0BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERTCL=noMASTER=bond0SLAVE=yesrootio102 network-scripts#

4、 cat ifcfg-eth1DEVICE=eth1BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERTCL=noMASTER=bond0SLAVE=yesrootio102 network-scripts# cat ifcfg-eth2DEVICE=eth2BOOTPROTO=noneONBOOT=yesTYPE=EthernetUSERTCL=noMASTER=bond0SLAVE=yesrootio102 network-scripts# cat ifcfg-eth3DEVICE=eth3BOOTPROTO=noneONBOOT=yesTYPE=Ether

5、netUSERTCL=noMASTER=bond0SLAVE=yes(3)查看bond0的状态rootio102 # more /proc/net/bonding/bond0Ethernet Channel Bonding Driver: v2.6.3-rh (June 8, 2005)Bonding Mode: IEEE 802.3ad Dynamic link aggregationMII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0802.3ad infoLACP rate: slow

6、Active Aggregator Info: Aggregator ID: 1 Number of ports: 4 Actor Key: 17 Partner Key: 480 Partner Mac Address: 00:12:f2:cd:68:00Slave Interface: eth0MII Status: upLink Failure Count: 0Permanent HW addr: 00:1e:0b:73:56:26Aggregator ID: 1Slave Interface: eth1MII Status: upLink Failure Count: 0Permane

7、nt HW addr: 00:1e:0b:73:56:a2Aggregator ID: 1Slave Interface: eth2MII Status: upLink Failure Count: 0Permanent HW addr: 00:1e:0b:d5:34:d2Aggregator ID: 1Slave Interface: eth3MII Status: upLink Failure Count: 0Permanent HW addr: 00:1e:0b:d5:34:d0Aggregator ID: 1然后在交换机(这里的交换机是Foundry)端做TRUNK将同一台服务器的多个

8、网卡捆绑成一条逻辑的线路来使用,提高服务器与交换机之间的带宽,并且能够负载均衡多个网卡上的流量,以及多个网卡之间的冗余当其中一个网卡坏了其它的网卡会平分坏网卡上的流量 ,并不影响服务器与交换机之间的数据转发。注 如果交换机配置为trunk 那么服务器段也要做相应的配置 trunk 才能被正确的使用BR-telnetYJY_SX_1600#show trunkConfigured trunks:Trunk ID: 897Hw Trunk ID: 6Ports_Configured: 4Primary Port Monitored: JointlyPorts 15/1 15/2 15/3 15/4

9、 Port Names none none none none Port_Status enableenableenableenableMonitor off off off off Rx Mirr PortN/A N/A N/A N/A Tx Mirr PortN/A N/A N/A N/A Monitor Dir N/A N/A N/A N/A Trunk ID: 901Hw Trunk ID: 11Ports_Configured: 4Primary Port Monitored: JointlyPorts 15/5 15/6 15/7 15/8 Port Names none none

10、 none none Port_Status enableenableenableenable Monitor off off off off Rx Mirr PortN/A N/A N/A N/A Tx Mirr PortN/A N/A N/A N/A Monitor Dir N/A N/A N/A N/A 查看如上的红色标注信息 端口状态是enable 本组trunk 包括 15/5 15/6 15/7 15/8 这4个端口本组trunk 已经生效然后在交换机(这里的交换机是Foundry)端做TRUNK将同一台服务器的多个网卡捆绑成一条逻辑的线路来使用,提高服务器与交换机之间的带宽,并且

11、能够负载均衡多个网卡上的流量,以及多个网卡之间的冗余当其中一个网卡坏了其它的网卡会平分坏网卡上的流量,并不影响服务器与交换机之间的数据转发。注 如果交换机配置为trunk 那么服务器段也要做相应的配置 trunk 才能被正确的使用BR-telnetYJY_SX_1600#show trunkConfigured trunks:Trunk ID: 897Hw Trunk ID: 6Ports_Configured: 4Primary Port Monitored: JointlyPorts 15/1 15/2 15/3 15/4 Port Names none none none none Po

12、rt_Status enableenableenableenableMonitor off off off off Rx Mirr PortN/A N/A N/A N/A Tx Mirr PortN/A N/A N/A N/A Monitor Dir N/A N/A N/A N/A Trunk ID: 901Hw Trunk ID: 11Ports_Configured: 4Primary Port Monitored: JointlyPorts 15/5 15/6 15/7 15/8 Port Names none none none none Port_Status enableenabl

13、eenableenable Monitor off off off off Rx Mirr PortN/A N/A N/A N/A Tx Mirr PortN/A N/A N/A N/A Monitor Dir N/A N/A N/A N/A 查看如上的红色标注信息 端口状态是enable 本组trunk 包括 15/5 15/6 15/7 15/8 这4个端口本组trunk 已经生效在modprobe.conf文件中,miimon参数用来监测网卡物理连接,建议至少设为100mode参数用来设置绑定模式0负载均衡(round robin策略)1 active/backup模式,同一时间只有一块网卡使用。2负载均衡(xor算法)3广播模式4 802.3ad模式,lagp协议,带宽翻倍。模式不能写错

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号