H3C
link-aggregation load-sharing mode { { destination-ip | destination-port | ip-protocol | source-ip | source-port }
二、 实验
Cisco私有的PAgP的链路聚合协议配置(PT模拟2层)
1. 实验拓扑
说明:
默认情况下,交换机会使用STP协议阻塞其中某个端口,因为上面的网络存在环路。
使用PAgP链路聚合充分利用冗余的链路带宽
2. 配置
Switch>en Switch#conf t
Switch(config)#hostname SW0 SW0(config)#int ra fa 0/1-2 SW0(config-if-range)#no sh
6
SW0(config-if-range)#switchport SW0(config-if-range)#channel-protocol lacp Prepare interface for LACP protocol pagp Prepare interface for PAgP protocol SW0(config-if-range)#channel-protocol pagp SW0(config-if-range)#channel-group <1-48> Channel group number
SW0(config-if-range)#channel-group 1 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
SW0(config-if-range)#channel-group 1 mode desirable //主动进入协商状态
Switch>en Switch#conf t
Switch(config)#hostname SW1 SW1(config)#int ra fa 0/1-2 SW1 (config-if-range)#no sh SW1 (config-if-range)#switchport
SW1 (config-if-range)#channel-protocol pagp
SW1 (config-if-range)#channel-group 1 mode auto //被动进入协商模式 Switch(config-if-range)#
%LINK-5-CHANGED: Interface Port-channel 1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 1, changed state to up
Switch(config-if-range)#
7
3. 验证
查看聚合组信息
SW0(config-if-range)#do show etherchannel port-channel Channel-group listing: ---------------------- Group: 1 ----------
Port-channels in the group: ---------------------------
Port-channel: Po1 ------------
Age of the Port-channel = 00d:00h:01m:56s Logical slot/port = 2/1 Number of ports = 2 GC = 0x00000000 HotStandBy port = null Port state = Port-channel Protocol = PAGP Port Security = Disabled
Ports in the Port-channel:
Index Load Port EC state No of bits ------+------+------+------------------+----------- 0 00 Fa0/1 Desirable-Sl 0
8
0 00 Fa0/2 Desirable-Sl 0
Time since last port bundled: 00d:00h:01m:05s Fa0/2 SW0(config-if-range)#
查看聚合链路的汇总信息
SW0(config-if-range)#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) PAgP Fa0/1(P) Fa0/2(P) SW0(config-if-range)#
4. 测试容错性
配置SW0和SW1的VLAN 1 的IP地址,测试聚合链路的容错 SW0(config-if-range)#int vlan 1
9
SW0(config-if)#no shutdown
SW0(config-if)#ip add 192.168.1.1 255.255.255.0 SW0(config-if)#
SW1(config-if-range)#int vlan 1 SW1(config-if)#no sh
SW1(config-if)#ip add 192.168.1.2 255.255.255.0 SW1(config-if)#
测试聚合端口的冗余容错特性
在SW0上向SW1持续发送ICMP数据包 SW0(config-if)#do ping Protocol [ip]: ip
Target IP address: 192.168.1.2 Repeat count [5]: 10000 Datagram size [100]: 100 Timeout in seconds [2]: 2 Extended commands [n]: n Sweep range of sizes [n]: n Type escape sequence to abort.
Sending 10000, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
然后在SW1上将聚合组中的fa 0/2关掉,观察ping数据包是否中断 SW1(config)#int fa 0/2 SW1(config-if)#no sh SW1(config-if)#no shutdown
10