1、实验需求:
按照图中的IP对PC进行配置,在SW1与SW2上配置链路聚合,确保其中任何一根链路离线,另外一个链路依旧能够提供通信。
2、实验拓扑
3、实验步骤
(1)配置PC地址,此部分省略。
(2)配置SW1与SW2交换机上的链路聚合。
SW1:
[H3C]int Bridge-Aggregation 1
SW2:
[H3C]int Bridge-Aggregation 1
(3)将SW1与SW2交换机上两个接口加入链路聚合。
SW1:
[H3C]int g1/0/1
[H3C-GigabitEthernet1/0/1]port link-aggregation group 1
[H3C]int g1/0/2
[H3C-GigabitEthernet1/0/2]port link-aggregation group 1
SW2:
[H3C]int g1/0/1
[H3C-GigabitEthernet1/0/1]port link-aggregation group 1
[H3C]int g1/0/2
[H3C-GigabitEthernet1/0/2]port link-aggregation group 1
(4)查看链路运行状态
SW1:
[H3C]display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port: A -- Auto
Port Status: S -- Selected, U -- Unselected, I -- Individual
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,D -- Synchronization, E -- Collecting, F -- Distributing,G -- Defaulted, H -- ExpiredAggregate Interface: Bridge-Aggregation1
Aggregation Mode: Static
Loadsharing Type: SharPort Status Priority Oper-Key
--------------------------------------------------------------------------------GE1/0/1 S 32768 1GE1/0/2 S 32768 1
(5)配置SW1与SW2上的两个接入为Trunk接口类型,允许所有接口通过。由于链路聚合会自动承接物理接口的属性,所以不需要在物理接口上配置Trunk,直接在链路聚合接口下配置即可。
SW1:
[H3C]int Bridge-Aggregation 1
[H3C-Bridge-Aggregation1]port link-type trunk
Configuring GigabitEthernet1/0/1 done.
Configuring GigabitEthernet1/0/2 done.
[H3C-Bridge-Aggregation1]port trunk permit vlan all
Configuring GigabitEthernet1/0/1 done.
Configuring GigabitEthernet1/0/2 done.
SW2:
[H3C]int Bridge-Aggregation 1
[H3C-Bridge-Aggregation1]port link-type trunk
Configuring GigabitEthernet1/0/1 done.
Configuring GigabitEthernet1/0/2 done.
[H3C-Bridge-Aggregation1]port trunk permit vlan all
Configuring GigabitEthernet1/0/1 done.
Configuring GigabitEthernet1/0/2 done.
(6)测试连通性。
PC3:
<H3C>
<H3C>ping 192.168.1.2
Ping 192.168.1.2 (192.168.1.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.1.2: icmp_seq=0 ttl=255 time=3.000 ms
56 bytes from 192.168.1.2: icmp_seq=1 ttl=255 time=2.000 ms
56 bytes from 192.168.1.2: icmp_seq=2 ttl=255 time=1.000 ms
56 bytes from 192.168.1.2: icmp_seq=3 ttl=255 time=1.000 ms
56 bytes from 192.168.1.2: icmp_seq=4 ttl=255 time=1.000 ms--- Ping statistics for 192.168.1.2 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.000/1.600/3.000/0.800 ms
<H3C>%Apr 26 10:22:28:407 2022 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.1.2: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.000/1.600/3.000/0.800 ms.
(7)断掉一根链路再进行测试。
SW1:
[H3C]int g1/0/1
[H3C-GigabitEthernet1/0/1]shutdown
(8)断掉后测试连通性。
PC3:
<H3C>ping 192.168.1.2
Ping 192.168.1.2 (192.168.1.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.1.2: icmp_seq=0 ttl=255 time=1.000 ms
56 bytes from 192.168.1.2: icmp_seq=1 ttl=255 time=2.000 ms
56 bytes from 192.168.1.2: icmp_seq=2 ttl=255 time=1.000 ms
56 bytes from 192.168.1.2: icmp_seq=3 ttl=255 time=1.000 ms
56 bytes from 192.168.1.2: icmp_seq=4 ttl=255 time=1.000 ms--- Ping statistics for 192.168.1.2 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms
<H3C>%Apr 26 10:26:38:356 2022 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.1.2: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms.
注:
1:显示链路聚合组信息
[H3C]display link-aggregation summary
2:显示链路聚合状态
[H3C]display link-aggregation verbose