端口匯聚是一種邏輯上的抽象過程,將一組具備相同屬性的端口,抽象成一個邏輯端口。port channel是一組物理端口的集合體,在邏輯上被當作一個物理端口。對用戶來講,完全可以將這個port channel 當作一個端口使用,因此不僅能增加網絡的帶寬,還能提供鏈路的備份功能。
爲使port channel 正常工作,port channel 的成員端口必須具備以下相同的屬性:
1 端口均爲全雙工模式;
2 端口速率相同;
4 端口同爲access 端口並且屬於同一個vlan 或同爲trunk 端口;
PAgP(Port Aggregation Protocol)端口聚集協議幫助在快速以太通道鏈接中聯繫自動生成
LACP(Link Aggregation Control Protocol,鏈路匯聚控制協議)是一種實現鏈路動態匯聚的協議
PAGP 屬於cisco私有協議,LACP是公有協議。
PAgP的工作模式 ------- 對應的 LACP工作模式
on(開) ------- on
auto(自動) ------- passive
desirable(主動)------- active
以上來自互聯網
配置設備WEB IOU ,配置拓撲:
命令:
SW1(config)#interface port-channel 1 建立一個以太網port-channel 1
SW1(config-if)#switchport trunk encapsulation dot1q port-channel 1 中的接口trunk封裝的類型 (35一下的貌似可以不用)
SW1(config-if)#switchport mode trunk port-channel 1 封裝爲trunk模式
SW1(config-if)#speed 100 設置port-channel 的端口速率
SW1(config-if)#duplex full 設置port-channel 的雙工模式
SW1(config)#interface ethernet 0/0
SW1(config-if)#speed 100
SW1(config-if)#duplex full
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#channel-group 1 mode on 設置將接口加入channel-group 1中,並定義模式爲手動聚合(ON不屬於任何協議)
SW1(config)#interface ethernet 0/1
SW2 配置如上
查看命令
SW1#show etherchannel summary 查看端口聚合的彙總信息
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, no aggregation due to minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
d - default port
w - waiting to be aggregated
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) - Et0/0(P) Et0/1(P)
SW2#show etherchannel summary
Flags: D - down P - bundled in port-channel
I - stand-alone s - suspended
H - Hot-standby (LACP only)
R - Layer3 S - Layer2
U - in use N - not in use, no aggregation
f - failed to allocate aggregator
M - not in use, no aggregation due to minimum links not met
m - not in use, port not aggregated due to minimum links not met
u - unsuitable for bundling
d - default port
w - waiting to be aggregated
Number of channel-groups in use: 1
Number of aggregators: 1
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) - Et0/0(s) Et0/1(P)
SW1(config-if)#channel-group 1 mode desirable 模式變爲PAGP協議
SW1(config-if)#channel-group 1 mode active 模式變爲LACP協議
SW2 對端依據協商模式來配置,
desirable-desirable
desirable-auto
active-active
active-passive