欢迎来到天天文库
浏览记录
ID:38777868
大小:20.40 KB
页数:5页
时间:2019-06-19
《在linux(redhat)下双网卡负载均衡(lacp)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、(一)linux配置#cat/boot/config-kernel-version
2、grep-ibondingCONFIG_BONDING=m返回CONFIG_BONDING=m表示支持,否则需要编译内核使它支持bonding也可以用:查看一下内核是否已经支持bonding:modinfobonding第一步:创建一个ifcfg-bondX#touch/etc/sysconfig/network-scripts/ifcfg-bond0新建一个bond0配置文件#cat/etc/sysconfig/network-scripts/ifcfg-bond0DEVICE
3、=bond0BOOTPROTO=staticIPADDR=1.1.1.2NETMASK=255.255.255.0BROADCAST=1.1.1.255NETWORK=1.1.1.0GATEWAY=1.1.1.1ONBOOT=yesTYPE=Ethernet编辑ifcfg-bond0如上第二步:修改/etc/sysconfig/network-scripts/ifcfg-ethX这个实验中把网卡1和2绑定,修改/etc/sysconfig/network-scripts/ifcfg-ethX相应网卡配置如下:#cat/etc/sysconfig/network-
4、scripts/ifcfg-eth1TYPE=EthernetDEVICE=eth1HWADDR=00:d0:f8:40:f1:a0网卡1macBOOTPROTO=noneONBOOT=yesUSERCTL=noMASTER=bond0SLAVE=yes#cat/etc/sysconfig/network-scripts/ifcfg-eth2TYPE=EthernetDEVICE=eth2HWADDR=00:d0:f8:00:0c:0c网卡2macBOOTPROTO=noneONBOOT=yesUSERCTL=noMASTER=bond0SLAVE=yes第三步
5、:配置/etc/modprobe.conf,添加aliasbond0bonding#cat/etc/modprobe.confaliaseth0e100aliassnd-card-0snd-intel8x0optionssnd-card-0index=0optionssnd-intel8x0index=0removesnd-intel8x0{/usr/sbin/alsactlstore0>/dev/null2>&1
6、
7、:;};/sbin/modprobe-r--ignore-removesnd-intel8x0aliaseth18139toooptions3c5
8、01irq=3aliaseth2tulip上面是三网卡本身的配置如果要绑定和做lacp只要再加上下面两条配置aliasbond0bonding绑定optionsbond0miimon=100mode=4mode=4是lacp第四步:配置/etc/rc.d/rc.local,添加需要绑定的网卡#cat/etc/rc.d/rc.localtouch/var/lock/subsys/local配置本身就有这条命令ifenslavebond0eth1eth2这条命令是添加需要绑定的网卡1和2到这里就完成bonding的配置了可以查看一下第五步:重启网络服务和重启pc#s
9、ervicenetworkrestart重启网络服务#shutdown-rnow重启pc重启后可以查看bonding情况:网卡1和2都绑定上了,模式为802.3ad#cat/proc/net/bonding/bond0EthernetChannelBondingDriver:v3.0.3(March23,2006)BondingMode:IEEE802.3adDynamiclinkaggregationTransmitHashPolicy:layer2(0)MIIStatus:upMIIPollingInterval(ms):100UpDelay(ms):0Do
10、wnDelay(ms):0802.3adinfoLACPrate:slowActiveAggregatorInfo:AggregatorID:1Numberofports:2ActorKey:9PartnerKey:1PartnerMacAddress:00:d0:f8:22:33:baSlaveInterface:eth1MIIStatus:upLinkFailureCount:0PermanentHWaddr:00:d0:f8:40:f1:a0AggregatorID:1SlaveInterface:eth2MIIStatus:upLinkFailureCo
11、unt:0Permane
此文档下载收益归作者所有