静态链路聚合实验

实验拓扑

image-20240116093202559

实验需求

  1. 按照图示搭建拓扑并配置IP地址

  2. 将SWA和SWB的g1/0/4加入到vlan10中,g1/0/5加入到vlan20中

  3. SWA和SWB之间使用静态链路聚合,并trunk放行vlan10,vlan20

  4. 测试,用ping命令来检测PC1与PC2的互通性

实验解析

1、配置IP地址

步骤1:配置PC1的IP地址

image-20240116103730609

步骤2:配置PC2的IP地址

image-20240116103745125

步骤3:配置PC3的IP地址

image-20240116103803729

步骤4:配置PC4的IP地址

image-20240116103820497

2、将SWA和SWB的g1/0/4加入到vlan10中,g1/0/5加入到vlan20中

步骤1:将SWA的g1/0/4加入到vlan10中,g1/0/5加入到vlan20中

[SWA]vlan 10
[SWA-vlan10]port g1/0/4
[SWA-vlan10]vlan 20
[SWA-vlan20]port g1/0/5

步骤2:将SWB的g1/0/4加入到vlan10中,g1/0/5加入到vlan20中

[SWB]vlan 10
[SWB-vlan10]port g1/0/4
[SWB-vlan10]vlan 20
[SWB-vlan20]port g1/0/5

3、SWA和SWB之间使用静态链路聚合,并trunk放行vlan10,vlan20

步骤1:SWA上配置静态链路聚合,并trunk放行vlan10,vlan20

[SWA]interface Bridge-Aggregation 1
[SWA-Bridge-Aggregation1]qu
[SWA]int range g1/0/1 g1/0/2 g1/0/3 
[SWA-if-range]port link-aggregation group 1
[SWA-Bridge-Aggregation1]port link-type trunk 
[SWA-Bridge-Aggregation1]port trunk permit vlan 10 20

步骤2:SWB上配置静态链路聚合,并trunk放行vlan10,vlan20

[SWB]int Bridge-Aggregation 1
[SWB-Bridge-Aggregation1]qu
[SWB]int range g1/0/1 g1/0/2 g1/0/3
[SWB-if-range]port link-aggregation group 1
[SWB-Bridge-Aggregation1]port link-type trunk 
[SWB-Bridge-Aggregation1]port trunk permit vlan 10 20

4、用ping命令来检测PC1与PC2的互通性

分别在SWA和SWB上通过display link-aggregation verbose 来显示链路聚合的详细信息

<SWA>display link-aggregation verbose 
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing 
Port Status: S -- Selected, U -- Unselected, I -- Individual 
Port: A -- Auto port, M -- Management port, R -- Reference port 
Flags:  A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation, 
        D -- Synchronization, E -- Collecting, F -- Distributing, 
        G -- Defaulted, H -- Expired 

Aggregate Interface: Bridge-Aggregation1
Aggregation Mode: Static
Loadsharing Type: Shar
Management VLANs: None
  Port             Status  Priority Oper-Key
  GE1/0/1(R)       S       32768    1         
  GE1/0/2          S       32768    1         
  GE1/0/3          S       32768    1      
  
  <SWB>display link-aggregation verbose 
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing 
Port Status: S -- Selected, U -- Unselected, I -- Individual 
Port: A -- Auto port, M -- Management port, R -- Reference port 
Flags:  A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation, 
        D -- Synchronization, E -- Collecting, F -- Distributing, 
        G -- Defaulted, H -- Expired 

Aggregate Interface: Bridge-Aggregation1
Aggregation Mode: Static
Loadsharing Type: Shar
Management VLANs: None
  Port             Status  Priority Oper-Key
  GE1/0/1(R)       S       32768    1         
  GE1/0/2          S       32768    1         
  GE1/0/3          S       32768    1     

用ping命令来检测PC1与PC2的互通性,结果是可以互通的

<H3C>ping 192.168.10.2
Ping 192.168.10.2 (192.168.10.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.10.2: icmp_seq=0 ttl=255 time=2.341 ms
56 bytes from 192.168.10.2: icmp_seq=1 ttl=255 time=1.088 ms
56 bytes from 192.168.10.2: icmp_seq=2 ttl=255 time=1.076 ms
56 bytes from 192.168.10.2: icmp_seq=3 ttl=255 time=1.067 ms
56 bytes from 192.168.10.2: icmp_seq=4 ttl=255 time=1.042 ms

用ping命令来检测PC1与PC4的互通性,结果是不能互通的

<H3C>ping 192.168.10.4
Ping 192.168.10.4 (192.168.10.4): 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out