EtherChannel

<EtherChannel>
·通過這個技術能夠將多個物理端口綁定爲一個邏輯端口
  通過多個端口綁定,能充分利用現有端口來增加帶寬。
·Cisco交換機最多允許綁定8個端口。
  如果是快速以太網,總帶寬可達1600Mbit/s
  如果是Gbit以太網,總帶寬可達16Gbit/s
·綁定後的端口默認繼承原來物理接口的配置模式。
·etherchannel不支持10M端口的綁定
·cisco的交換機不僅可以支持第二層etherchannel,還可以支持第三層etherchannel。
·一個etherchannel內所有的端口都必須具有相同的速率和雙工模式。LACP只能是全雙工。
 
二層接口和三層接口的區別:
二層接口不能配置IP地址,不能宣告進路由協議,只能對二層以太網幀進行轉發。
三層接口可以配置IP地址,可運行路由協議,能接收IP包並且轉發。
EtherChannel的模式:
可以直接將物理端口綁定,也可以讓兩臺交換機之間通過協議進行協商,來形成channel通道。
On:強行起etherchannel
Sw1(config)#int range f0/8 ,f0/9
Sw1(config-if-range)#channel-group 1 mode on 將這兩個接口綁定爲一組並指定on模式  組號本地有效
Sw1(config)#interface  port-channel  1
Sw1(config-if)#switchport  mode  trunk 指定接口模式爲trunk,如不指定,會自動繼承物理接口的模式
Sw1#show etherchannel summary 可以看到綁定了多少接口
Show interface etherchannel
Sw1(config)#no interface port-channel 1 拆除etherchannel
強行起通道的話要在短期內在雙方啓用。否則可能環路。協商起鏈路則沒有這問題,因爲啓用不起通道的話會down。
Port Aggregation Protocol (PAgP)端口匯聚協議
Cisco私有技術,這個協議又有兩種模式:
  auto:被動  只收不發
 Desirable:主動 會發也會收協商消息
Sw1(config)#int range f0/8 ,f0/9
Sw1(config-if-range)#channel-group 1 mode desible
Sw1(config)#int range f0/8 ,f0/9
Sw1(config-if-range)#channel-group 1 mode auto
Sw1(config)#interface  port-channel  1
Sw1(config-if)#switchport  mode  trunk
Link Aggregation Control Protocol (LACP) 鏈路聚合控制協議
802.3ad,業界標準
 Passvie相當於PAgP的auto 
 Active相當於PAgP的desirable  又發又收協商消息
Sw1(config)#int range f0/8 ,f0/9
Sw1(config-if-range)#channel-group 1 mode passive
Sw1(config)#int range f0/8 ,f0/9
Sw1(config-if-range)#channel-group 1 mode active
Sw1(config)#interface  port-channel  1
Sw1(config-if)#switchport  mode  trunk
show etherchannel 1 summary
show etherchannel  summary  查看所有的group
還有一種好的辦法是先對每個接口封裝trunk,再劃入channel-group中,channel-group接口會自動繼承trunk
注:channel-group接口會自動繼承第一個物理接口的接口配置模式,或最先配置的接口模式。
配置三層channel
所謂三層的channel其實就是將多個三層接口綁定。只能在三層交換機上配置。
在3550這樣的交換機上,所有接口默認都是二層接口。首先需要將交換機的的二層接口改爲三層接口。可用以下命令實現:
3550(config)#interface  gigabitethernet 0/1
3550(config-if)#no  switchport
然後再綁定:
3550(config-if)#channel-group  1  mode  desirable
3550(config-if)#exit
將另一個端口也綁進來
3550(config)#interface  gigabitethernet 0/2
3550(config-if)#no  switchport
3550(config-if)#channel-group  1  mode  desirable
3550(config-if)#exit
給channel通道配上IP地址:
3550(config)#interface  port-channel  1
3550(config-if)#ip  address  100.1.1.1  255.255.255.0
當物理接口放進了邏輯接口,那物理接口的配置就忽略了,如ip地址。
配置etherchannel負載均衡
默認情況下是基於源MAC地址的負載均衡
port-channel load-balance [dst-mac|src-mac]
show etherchannel load-balance
3560可以基於源目IP來做負載均衡
Err-disable特性:
接口如果進入err-disable狀態:有兩種方法恢復
1、手動恢復
   先shutdown、再no shutdown
2、自動恢復
   errdisable recovery cause {all|arp-inspection|bpduguard|link-flap} 指定原因
   errdisable recovery interval 30   指定自動恢復時間間隔


兩臺交換機之間是否形成EtherChannel也可以用協議自動協商。目前有兩個協商協議:PAGP和LACP,前者是CISCO專有的協議,而LACP是公共的標準。
 
LACP協商的規律
                ON      active      passive
ON           √            ×               ×
active       ×           √               √
passive    ×           √                ×
 
PAGP協商的規律
               ON      Desirable     auto
ON           √            ×                ×
desirable ×            √                √
auto         ×            √                ×
 
要想把接口配置爲PAGP 的desirable 模式使用命令:“channel-group 1 mode desirable”;
要想把接口配置爲PAGP 的auto 模式使用命令:“channel-group 1 mode auto”;
要想把接口配置爲LACP 的active 模式使用命令:“channel-group 1 mode active”;
要想把接口配置爲LACP 的passive 模式使用命令:“channel-group 1 mode passive”。
 
端口通道負載均衡  port-channel load-balance
sw1(config)#port-channel load-balance ?
  dst-ip       Dst IP Addr
  dst-mac      Dst Mac Addr
  src-dst-ip   Src XOR Dst IP Addr
  src-dst-mac  Src XOR Dst Mac Addr
  src-ip       Src IP Addr
  src-mac      Src Mac Addr
 
 
sw1#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel  Ports
-----+------------+-----------------------------------------------------------
1     Po1(SD)     Fa0/0(s)   Fa0/1(s) 
 
 
sw1#show etherchannel load-balance
 Po1 ---> Source XOR Destination IP address
 
備註:
1、以太網通道最多可以捆綁8條物理鏈路
2、捆綁遵循以下規則:
       (1)相同VLAN
       (2)端口中繼模式
       (3)相同speed和duplex

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章