資源描述:
《Linux下雙網(wǎng)卡綁定七種模式》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在教育資源-天天文庫。
1、深度分析Linux下雙網(wǎng)卡綁定七種模式現(xiàn)在一般的企業(yè)都會使用雙網(wǎng)卡接入,這樣既能添加網(wǎng)絡帶寬,同時又能做相應的冗余,可以說是好處多多。而一般企業(yè)都會使用linux操作系統(tǒng)下自帶的網(wǎng)卡綁定模式,當然現(xiàn)在網(wǎng)卡產(chǎn)商也會出一些針對windows操作系統(tǒng)網(wǎng)卡管理軟件來做網(wǎng)卡綁定(windows操作系統(tǒng)沒有網(wǎng)卡綁定功能需要第三方支持)。進入正題,linux有七種網(wǎng)卡綁定模式:0.?roundrobin,1.active-backup,2.loadbalancing(xor),?3.fault-tolerance(broadcast),4.lacp,?5.transm
2、itloadbalancing,6.adaptiveloadbalancing。第一種:bond0:roundrobin標準:round-robinpolicy:Transmitpacketsinsequentialorderfromthefirstavailableslavethroughthelast.Thismodeprovidesloadbalancingandfaulttolerance.特點:(1)所有鏈路處于負載均衡狀態(tài),輪詢方式往每條鏈路發(fā)送報文,基于perpacket方式發(fā)送。服務上ping一個相同地址:1.1.1.1雙網(wǎng)卡的兩個網(wǎng)卡都
3、有流量發(fā)出。負載到兩條鏈路上,說明是基于perpacket方式,進行輪詢發(fā)送。(2)這模式的特點增加了帶寬,同時支持容錯能力,當有鏈路出問題,會把流量切換到正常的鏈路上。實際綁定結果:cat/proc/net/bonding/bond0EthernetChannelBondingDriver:v3.6.0(September26,2009)BondingMode:loadbalancing(round-robin) ?。遥业哪J組IIStatus:upMIIPollingInterval(ms):100UpDelay(ms):0DownDela
4、y(ms):0SlaveInterface:eth0MIIStatus:upLinkFailureCount:0PermanentHWaddr:74:ea:3a:6a:54:e3SlaveInterface:eth1MIIStatus:upLinkFailureCount:0應用拓撲:交換機端需要配置聚合口,cisco叫portchannel。拓撲圖如下:第二種:bond1:active-backup標準文檔定義:Active-backuppolicy:Onlyoneslaveinthebondisactive.Adifferentslavebecome
5、sactiveif,andonlyif,theactiveslavefails.Thebond’sMACaddressisexternallyvisibleononlyoneport(networkadapter)toavoidconfusingtheswitch.Thismodeprovidesfaulttolerance.Theprimaryoptionaffectsthebehaviorofthismode.模式的特點:一個端口處于主狀態(tài),一個處于從狀態(tài),所有流量都在主鏈路上處理,從不會有任何流量。當主端口down掉時,從端口接手主狀態(tài)。實際綁定結
6、果:root@1:~#cat/proc/net/bonding/bond0EthernetChannelBondingDriver:v3.6.0(September26,2009)BondingMode:fault-tolerance(active-backup)—–backup模式PrimarySlave:NoneCurrentlyActiveSlave:eth0MIIStatus:upMIIPollingInterval(ms):100UpDelay(ms):0DownDelay(ms):0SlaveInterface:eth0MIIStatus:u
7、pLinkFailureCount:0PermanentHWaddr:74:ea:3a:6a:54:e3SlaveInterface:eth1MIIStatus:upLinkFailureCount:0PermanentHWaddr:d8:5d:4c:71:f9:94應用拓撲:這種模式接入不需要交換機端支持,隨便怎么接入都行。第三種:bond2:loadbalancing(xor)標準文檔描述:XORpolicy:Transmitbasedon[(sourceMACaddressXOR'dwithdestinationMACaddress)modulos
8、lavecount].Thisselectsthesameslaveforeac