华为交换机配置实用手册 

实验一  使用华为Quidway系列交换机简单组网1.1 实验目的
1. 掌握华为Quidway系列交换机上的基本配置命令;
2. 掌握VLAN的原理和配置;
3. 掌握端口聚合(Link Aggregation)的原理和配置;
4. 掌握生成树协议(STP)的原理和配置;
5. 掌握GVRP协议的原理和配置;
6. 掌握三层交换机和访问控制列表(ACL)的原理和配置;
7. 掌握如何从PC机或其他交换机远程配置某交换机。
1.2 实验环境
Quidway S3026以太网交换机 2 台,Quidway S3526以太网交换机1台,
PC机4台,标准网线6根
Quidway S3026软件版本:V100R002B01D011;Bootrom版本:V1.1
Quidway S3526软件版本:V100R001B02D006;Bootrom版本:V3.0
1.3 实验组网图
在下面的每个练习中给出。
1.4 实验步骤
1.4.1   VLAN配置
首先依照下面的组网图将各实验设备相连,然后正确的配置各设备的IP地址。有两台Quidway S3026交换机和四台PC机。每台PC机的IP地址指定如下:
PCA:10.1.1.1
PCB:10.1.2.1
PCC:10.1.1.2
PCD:10.1.2.2
掩码:255.255.255.0
请完成以下步骤:
1、  如上图所示,配置四台PC机属于各自的VLAN。
2、  将某些端口配置成trunk端口,并允许前面配置的所有VLAN通过。
3、  测试同一VLAN中的PC机能否相互Ping通。
配置如下:
SwitchA:
SwitchA(config)#vlan 2                                                  //创建VLAN 2
SwitchA (config-vlan2)# switchport ethernet 0/9               //将以太口9划入VLAN 2
SwitchA (config-vlan2)#vlan 3                                         //创建VLAN 3
SwitchA (config-vlan3)# switchport ethernet 0/10             //将以太口10划入VLAN 3
SwitchA (config-vlan3)#interface ethernet 0/1                   //进入以太口1的接口配置模式
SwitchA (config-if-Ethernet0/1)#switch mode trunk          //将e0/1接口设置为trunk模式
SwitchA (config-if-Ethernet0/1)#switch trunk allow vlan all //配置允许所有的VLAN通过
SwitchB:
SwitchB(config)#vlan 2
SwitchB (config-vlan2)# switchport ethernet 0/9
SwitchB (config-vlan2)#vlan 3
SwitchB (config-vlan3)# switchport ethernet 0/10
SwitchB (config-vlan3)#interface ethernet 0/1
SwitchB (config-if-Ethernet0/1)# switch mode trunk
SwitchB (config-if-Ethernet0/1)# switch trunk allow vlan all
4、  SwitchA端口e0/1的PVID配置为2,然后从PCA ping PCC,看能否相互Ping通,如果不能Ping通,请说明原因。
华为Quidway系列交换机有一个重要特性:如果帧的VLAN ID等于发送该帧的trunk端口的PVID,那么该帧将会先被删掉tag头,再发送。
5、  将SwitchA端口e0/1的配置改为属于VLAN2的接入端口,然后从PCApingPCC。你将会发现虽然SwitchA的e0/1、e0/9,SwitchB的e0/9都属于VLAN2,但PCA却不能Ping通PCC。请说明原因。
有两种方法可以通过改变SwitchB端口e0/1的配置使PCA能Ping通PCC。
方法一:将SwitchB端口e0/1的配置改为属于VLAN2的接入端口;
方法二:将SwitchB端口e0/1的PVID改为2。
6、  通过以上步骤,理解Quidway系列交换机添加和删除802.1qVLANtag头的过程和规则。
1.4.2   端口聚合(Link Aggregation)
在练习一的基础上再将SwitchA端口e0/2和SwitchB端口e0/2互连,如下图所示。VLAN和IP地址的配置保持不变。
1、  将SwitchA和SwitchB的端口e0/1和e0/2配置为端口聚合。
2、  改变SwitchA端口e0/1的配置,用“show interface e0/2”观察SwitchB端口e0/2的配置变化。
3、  将SwitchA和SwitchB之间的两根双绞线拔掉一根,看看PCA是否仍能Ping通PCC。请说明原因。
4、  通过以上步骤,理解端口聚合的功能和配置。
配置如下:
SwitchA:
SwitchA (config)#link-aggregation e 0/1 to e 0/2 ingress-egress  //将e0/1及e0/2做聚合
SwitchA (config)#interface e 0/1
SwitchA (config-if-Ethernet0/1)# switch mode trunk         //将e0/1接口设置为trunk模式
SwitchA (config-if-Ethernet0/1)# switch trunk allow vlan all //配置允许所有的VLAN通过
SwitchB:
SwitchB (config)link-aggregation e 0/1 to e 0/2 ingress-egress
SwitchB (config)#interface e 0/1
SwitchB (config-if-Ethernet0/1)# switch mode trunk
SwitchB (config-if-Ethernet0/1)# switch trunk allow vlan all
--------------------------------------------------------------------------------
1.4.3 生成树协议(STP)
我们仍然使用练习二的组网图。这次在SwitchA和SwitchB之间不再用端口聚合,而是配置STP。
请完成以下步骤:
1、 在两台交换机上使能STP。
掩码:255.255.255.0
请完成以下步骤:
1、  如上图所示,配置四台PC机分别属于各自相关的VLAN。
2、  配置端口聚合,使SwitchA和SwitchB之间的带宽为200Mbps。
3、  配置某些端口为trunk端口并允许前面配置的所有VLAN通过。
4、  在两台交换机的端口e0/1配置GVRP,使能动态注册VLAN信息。
5、  测试在同一VLAN内的PC机能否互相Ping通。
以上配置我们在前面的练习中已全部学过,另外还需要完成以下工作:
我们需要使PCB不能和PCA、PCC通信,PCD能和PCA、PCB、PCC通信。当然,PCA和PCC仍能互相通信。
 
我们知道,不同VLAN间的通信在二层是隔离的。所以我们必须寻找一种方法能够通过三层实现通信。SwitchA(QuidwayS3526)是一种三层交换机,能帮助我们解决这个问题。按以下步骤来实现不同VLAN之间的PC机互通:
00 255.255.255.0
!
!
!
!
!
!
!
!
!
!
!
!
!
!
end
2.4 实验步骤
1、  如上图所示将设备互连起来,并给每台PC机配置好IP地址。
   分配给PC机的IP地址如下:
          PCA:10.1.1.1
          PCB:10.1.2.1
          PCC:10.1.1.2
          PCD:10.1.3.1
  掩码:255.255.255.0
2、  如上图所示配置四台PC机属于相关的VLAN。配置端口聚合使得SwitchA和SwitchB、SwitchA和SwitchC之间的带宽为 200Mbps。配置某些端口为trunk端口并允许以上的所有VLAN通过。在所有交换机的trunk端口上配置GVRP,使得VLAN信息能被动态注 册。在所有交换机上配置STP以避免由于交换机之间的路径回环而产生“广播风暴”。然后测试同一VLAN间的PC机能否正常Ping通。
3、  用“show spanning-tree”命令观察生成树的状态。
以下是SwitchA(S3526)的生成树状态:
SwitchA#show spanning-tree statistics e0/1
 
   The bridge is executing the IEEE Rapid Spanning Tree protocol
   The bridge has priority 32768, MAC address: 00e0.fc06.81e0
   Configured Hello Time 2, Max Age 20, Forward Delay 15
   Root Bridge has priority 32768, MAC address 00e0.fc06.81e0
   Path cost to root bridge is 0
 
 
Port 1 (Ethernet0/1) of bridge is Forwarding
   Spanning tree protocol is enabled
   The port is a DesignatedPort
   Port path cost 180
   Port priority 128
   Designated bridge has priority 32768, MAC address 00e0.fc06.81e0
   Configured as a non-edge port
   Connected to a point-to-point LAN segment
   Maximum transmission limit is 3  BPDUs per hello time
   Times: Hello Time 2,    Max Age 20
          Forward Delay 15, Message Age 0
   sent BPDU:     8584
          TCN: 0, RST: 8584, Config BPDU: 0
   received BPDU: 7657
          TCN: 0, RST: 7657, Config BPDU: 0
SwitchA# show spanning-tree statistics e0/9
 
The bridge is executing the IEEE Rapid Spanning Tree protocol
   The bridge has priority 32768, MAC address: 00e0.fc06.81e0
   Configured Hello Time 2, Max Age 20, Forward Delay 15
   Root Bridge has priority 32768, MAC address 00e0.fc06.81e0
   Path cost to root bridge is 0
 
 
Port 9 (Ethernet0/9) of bridge is Forwarding
   Spanning tree protocol is enabled
   The port is a DesignatedPort
   Port path cost 180
   Port priority 128
   Designated bridge has priority 32768, MAC address 00e0.fc06.81e0
   Configured as a non-edge port
   Connected to a point-to-point LAN segment
   Maximum transmission limit is 3  BPDUs per hello time
   Times: Hello Time 2,    Max Age 20
          Forward Delay 15, Message Age 0
   sent BPDU:     6563
          TCN: 0, RST: 6563, Config BPDU: 0
   received BPDU: 5377361
          TCN: 0, RST: 5377361, Config BPDU: 0
ocol is enabled
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!