SwitchA
SwitchA# configure terminal SwitchA (config)# interface range GigabitEthernet1/1-2 SwitchA (config-if-range)# switchport mode access SwitchA (config-if-range)# switchport access vlan 10 SwitchA (config-if-range)# channel-group 5 mode on Switch(config-if-range)# end
SwitchB
SwitchB# configure terminal SwitchB(config)#interface range GigabitEthernet1/0/1-2 SwitchB(config-if-range)#switchport mode access SwitchB(config-if-range)#switchport access vlan 10 SwitchB(config-if-range)#channel-group 1 mode on Creating a port-channel interface Port-channel 1 SwitchB(config-if-range)#int port-channel 1 SwitchB(config-if)#exit SwitchB(config)#do 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 port Number of channel-groups in use: 1 Number of aggregators: 1 Group Port-channel Protocol Ports ------+-------------+-----------+----------------------------------------------- 1 Po1(SU) - Gi1/0/1(P) Gi1/0/2(P)
channel-group 4 mode active 这个命令控制是否用LACP的。
c4506(config)#inter g6/5 c4506(config-if)#channel-group 4 mode ? active Enable LACP unconditionally auto Enable PAgP only if a PAgP device is detected desirable Enable PAgP unconditionally on Enable Etherchannel only passive Enable LACP only if a LACP device is detected c4506(config-if)#channel-group 4 mode active
例 6.1. desirable
switch A
Switch(config)#interface range fa0/1-4 #range配置二个以上的接口 Switch(config-if-range)#channel-group 1 mode desirable #封装为自动协商模式 Switch(config-if-range)#switchport mode trunk Switch(config-if-range)#switchport trunk encapsulation dot1q Switch(config-if-range)#switchport trunk allowed vlan all #允许所以vlan通过
switch B
Switch(config)#interface range fa0/1-4 Switch(config-if-range)#channel-group 1 mode desirable Switch(config-if-range)#switchport mode trunk Switch(config-if-range)#switchport trunk encapsulation dot1q Switch(config-if-range)#switchport trunk allowed vlan all
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。