Port-Channel 的在實際工作中的主要作用是將兩個或多個端口捆綁成為一個虛擬通道。
interface Port-channel1
description port(1/0/5-6)
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10
switchport mode trunk
!
interface Port-channel2
description port(1/0/7-8)
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10
switchport mode trunk
!
interface Port-channel3
description port(1/0/9-10)
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10
switchport mode trunk
!
interface Port-channel4
description port(1/0/11-12)
shutdown
以上是我在Cisco 3750上做的配置,其中:
description port(1/0/5-6) 是對這個虛擬通道的描述,告知這個虛擬通道使用了端口1/0/ 的5和6端口
switchport trunk encapsulation dot1q 是強制虛擬通道使用dot 1q 來封裝數據包
switchport trunk allowed vlan 10 是強制虛擬通道能夠通過的VLAN,此例只有vlan10能通過此通道
switchport mode trunk 是強制為 triuk 模式
具體的命令如下:
3750-route#configure terminal
3750-route(config)#interface port-channel 1
3750-route(config-if)#switchport mode trunk
3750-route(config-if)#switchport trunk encapsulation dot1q
3750-route(config-if)#switchport trunk allowed vlan 10
3750-route(config-if)#description xxxxxx
創建 port-channel 1 后,還需要在相應的端口上進行配置
interface GigabitEthernet1/0/5
description Port-channel-1
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
!
interface GigabitEthernet1/0/6
description Port-channel-1
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
此處特別要提示的是最后的一條命令
channel-group 1 mode on 是 port-channel 1 可以調用此端口,換句話說:這個端口隸屬於 port-channel 1
具體命令如下:
3750-route#configure terminal
3750-route(config)#interface range gigabitEthernet 1/0/5-6
3750-route(config-if)#switchport mode trunk
3750-route(config-if)#switchport trunk encapsulation dot1q
3750-route(config-if)#description xxxxxx
3750-route(config-if)#channel-group 1 mode on
3750-route(config-if-range)#speed 100 //配速率
3750-route(config-if-range)#duplex full ////配速率
3750-route(config)#port-channel load-balance dst-ip ///配負載模式
端口聚合查看命令(排錯常用命令)
#查看端口聚合信息,正常情況Port-channel顯示是SU,如果顯示SD就不正常
Switch#show etherchannel summary
更具體的命令:
Switch#sh etherchannel 3 summary 查PO3 匯總信息,即綁定哪些接口 做聚合
1 Po1(SU) PAgP Fa0/23(P) Fa0/24(P)
2 Po2(SU) PAgP Fa0/21(P) Fa0/22(P)
#查看通道接口狀況
Switch#show etherchannel load-balance //查看負載信息
Switch# show etherchannel port-channel //查看port-channel詳細信息
Switch#sh int trunk 查所有允許trunk 通道的VLAN
更具體的命令:
Switch#sh int port-channel 1 trunk 查po1 允許通過的vlan ,trunk 通道
sh int etherchannel