交换机S1, S2之间有两条链路相连,如果捆绑在一起,成为一个逻辑聚合链路 (trunk),不但增加带宽,并提供冗余容错的能力。构成EtherChannel的端口必须具有相同的特性,如双工模式,速度,
. .
交换机S1, S2之间有两条链路相连,如果捆绑在一起,成为一个逻辑聚合链路 (trunk),不但增加带宽,并提供冗余容错的能力。
.构成EtherChannel的端口必须具有相同的特性,如双工模式,速度,trunking的状态等。可以采用手动配置和自动配置(PAGP或者LAGP)两种方法来配置EtherChannel。自动配置就是让EtherChannel协商协议自动协议,从而建立EtherChannel。
1、手动配置EtherChannel
S1>enableS1#config tEnter configuration commands, one per line. End with CNTL/Z.S1(config)#int port-channel 1 S1(config-if)#exit//以上创建EtherChannel 并指定唯一的编号 1 S1(config)#int f0/13S1(config-if)#channel-group 1 mode on S1(config-if)#exitS1(config)#int f0/14S1(config-if)#channel-group 1 mode on S1(config-if)#exit//以上将物理接口指定到已创建的通道中S1(config)#int port-channel 1S1(config-if)#switchport mode trunkS1(config-if)#speed 100S1(config-if)#duplex fullS1(config-if)#S1(config-if)#exit//以上配置通道中的物理接口的属性S1(config)#port-channel load-balance dst-macS1(config)#endS1#//以上配置EtherChannel 的负载平衡方式,命令格式为port-channel load-balance method。//负载平衡的方式有dst-ip、set-mac、src-dst-ip、src-dst-mac等。
.S2的配置步骤和S1一样!
.2、查看EtherChannel信息
S1#show etherchannel summary Flags: D - down P - in port-channel I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 S - Layer2 U - in use f - failed to allocate aggregator u - unsuitable for bundling w - waiting to be aggregated d - default portNumber of channel-groups in use: 1Number of aggregators: 1Group Port-channel Protocol Ports----------+----------------------+-----------------+----------------------------------1 Po1(SU) ------ Fa0/14(P) //可以看到,EtherChannel已经形成,‘SU’表示EtherChannel正常;如果显示为‘SD’,则把EtherChannel接口关闭重新开启。//关闭命令:no interface port-channel 1
3、配置PAGP或者LACP
技术要点:
要把接口配置为PAGP的desirable模式,使用channel-group 1 mode desirable命令。
要把接口配置为PAGP的auto模式,使用channel-group 1 mode auto命令。
要把接口配置为LAGP的active模式,使用channel-group 1 mode active命令。
要把接口配置为LAGP的passive模式,使用channel-group 1 mode passive命令。
S1(config)#int range f0/13-14S1(config-if-range)#channel-group 1 mode desirable//以上配置S1S2(config)#int range f0/13-14S2(config-if-range)#channel-group 1 mode desirable//以上配置S2S1#show etherchannel summaryFlags: D - down P - in port-channel I - stand-alone s - suspended H - Hot-standby (LACP only) R - Layer3 S - Layer2 U - in use f - failed to allocate aggregator u - unsuitable for bundling w - waiting to be aggregated d - default port Number of channel-groups in use: 1Number of aggregators: 1Group Port-channel Protocol Ports----------+----------------------+-----------------+----------------------------------1 Po1(SU) PApP Fa0/13(P) Fa0/14(P) //可以看到,EtherChannel协商成功,注意应在链路的两端进行检查,确认两端都形成EtherChannel通道才行
.