Cisco Port-Channel 设置(链路聚合--重点)

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

原文地址:https://www.cnblogs.com/qzqdy/p/8336858.html