EtherChannel(PAgP、LACP)基本配置


EtherChannel(PAgP、LACP)基本配置

EtherChannel

EtherChannel(以太通道)是由Cisco研發的,應用於交換機之間的多鏈路捆綁技術。它的基本原理是:將兩個設備間多條相同特性的快速以太或千兆位以太物理鏈路捆綁在一起組成一條邏輯鏈路,從而達到帶寬倍增的目的。除了增加帶寬外,EtherChannel還可以在多條鏈路上均衡分配流量,起到負載分擔的作用;當一條或多條鏈路故障時,只要還有鏈路正常,流量將轉移到其它的鏈路上,整個過程在幾毫秒內完成,從而起到冗余的作用,增強了網絡的穩定性和安全性。在EtherChannel中,負載在各個鏈路上的分布可以根據源IP地址、目的IP地址、源MAC地址、目的MAC地址、源IP地址和目的IP地址組合,以及源MAC地址和目的MAC地址組合等來進行分布。兩台交換機之間是否形成EtherChannel也可以用協議自動協商。目前有兩個協商協議:PAgP和LACP,PAgP(端口匯聚協議 Port Aggregation Protocol)是Cisco私有的協議,而LACP(鏈路匯聚控制協議 Link Aggregation Control Protocol)是基於IEEE 802.3ad的國際標准。

能形成EtherChannel的模式總結:

    PAgp  LACP
      desirable auto   active passive
  ON desirable active
ON auto × passive ×

 

 

 

 

 

1、ON :強行起etherchannel。

2、desirable:主動、會發送、也會接收協商信息。

3、auto:被動、不發送、只接收協商信息。

4、active:同desirable

5、passive:同auto

EtherChannel命令組合:

如果想把端口配置為on:

sw1(config-if-range)#channel-group 1 mode on

如果想把端口配置為PAgP的desirable:

sw1(config-if-range)#channel-protocol pagp

sw1(config-if-range)#channel-group 1 mode desirable

如果想把端口配置為PAgP的auto:

sw1(config-if-range)#channel-protocol pagp

sw1(config-if-range)#channel-group 1 mode auto

如果想把端口配置為LACP的active:

sw1(config-if-range)#channel-protocol lacp

sw1(config-if-range)#channel-group 1 mode active

如果想把端口配置為LACP的passive:

sw1(config-if-range)#channel-protocol lacp

sw1(config-if-range)#channel-group 1 mode passive

EtherChannel說明:

①Cisco最多允許EtherChannel綁定8個端口;

 1>如果是快速以太網,總帶寬可達1600Mbit/s;

 2>如果是Gbit以太網,總帶寬可達16Gbit/s。

②EtherChannel不支持10M端口;

③EtherChannel編號只在本地有效,鏈路兩端的編號可以不一樣;

④EtherChannel默認使用PAgP協議;

EtherChannel默認情況下是基於源MAC地址的負載平衡;

⑥一個EtherChannel內所有的端口都必須具有相同的端口速率和雙工模式,LACP只能是全雙工模式;

⑦channel-group接口會自動繼承最小物理接口,或最先配置的接口模式;

⑧cisco的交換機不僅可以支持第二層EtherChannel,還可以支持第三層EtherChannel。

 

實驗

命令:

sw1(config)#int port-channel 1       //創建以太通道,編號為1

sw1(config-if-range)#channel-group 1 mode on       //將物理接口指定到已創建的通道中,模式為on

sw1(config)#port-channel load-balance dst-ip      //配置以太通道的負載平衡方式,基於目的IP

說明:

①創建以太通道時要指定一個唯一的通道編號,編號范圍是1-6的整數,這個編號只有本地有效,因此鏈路兩端

  的編號可以不一樣;

②以太通道的負載平衡方式有:dst-ip、dst-mac、src-dst-ip、src-dst-mac、src-ip、src-mac,默認情況下

 是基於源MAC地址的負載平衡。

sw1     sw2
  Fa0/13 -- -- -- Fa0/13
  Fa0/14 -- -- -- Fa0/14

 

 

 

 

 

sw1(config)#int port-channel 1

sw1(config)#int range f0/13 - 14

sw1(config-if-range)#switchport trunk encapsulation dot1q

sw1(config-if-range)#switchport mode trunk

sw1(config-if-range)#speed 100

sw1(config-if-range)#duplex full

sw1(config-if-range)#channel-group 1 mode on

sw1(config)#port-channel load-balance dst-ip

sw2(config)#int port-channel 1

sw2(config)#int range f0/13 - 14

sw2(config-if-range)#switchport trunk encapsulation dot1q

sw2(config-if-range)#switchport mode trunk

sw2(config-if-range)#speed 100

sw2(config-if-range)#duplex full

sw2(config-if-range)#channel-group 1 mode on

sw2(config)#port-channel load-balance dst-ip

特別說明:如果本試驗中交換機sw2上接的是服務器,客戶計算機接在sw1上,這時在交換機sw1上應該配置為基於src-ip的負載平衡方式,而在sw2上應該配置為基於dst-ip的負載平衡方式。

實驗調試

sw1#show etherchannel summary       //查看EtherChannel信息

//可以看到group 1 的etherchannel 已經形成“SU”  表示Etherchannel 正常

如果為 “SD”  嘗試重新開啟接口
sw1#show etherchannel load-balance       //查看EtherChannel負載平衡方式


sw1#show etherchannel port-channel       //查看指定的EtherChannel包含的接口

 

 


sw1#show etherchannel protocol       //顯示各個Channel-group使用的協商協議


接口如果進入err-disable狀態有兩種方法恢復:

①手動恢復:先shutdown,再no shutdown;

②自動恢復:errdisable recovery cause {all|arp-inspection|bpduguard|link-flap}     指定原因

                      errdisable recovery interval 30                指定自動恢復時間間隔

                                                                                                                                                                                                                                                    注釋:本文來自於百度


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM