以太网是当今现有局域网LAN(Local Area Network)采用的最通用的通信协议标准,以太网作为一种原理简单、便于实现同时又价格低廉的局域网技术已经成为业界的主流。
本实验主要介绍了LAN网络中的Eth-Trunk技术和MSTP技术。
掌握手工模式及静态LACP模式下,Eth-Trunk的创建和维护。
掌握MSTP中包括MST域、MSTI、VLAN映射等配置和维护。
SwitchA、SwitchB、SwitchC和SwitchD都运行MSTP。为实现VLAN2~VLAN10和VLAN11~VLAN20的流量负载分担,MSTP设置VLAN映射表,把VLAN2~VLAN10关联实例1,VLAN11~VLAN20关联实例2。为保证交换机A和B链路带宽和稳定性,部署Eth-Trunk。
1.在处于环形网络中的交换设备上配置MSTP基本功能。与PC相连的端口不用参与MSTP计算,将其设置为边缘端口。
2.配置保护功能,实现对设备或链路的保护。例如:在各实例的根桥设备指定端口配置根保护功能。
3.配置设备的二层转发功能。
步骤 1配置SwitchA、SwitchB、SwitchC和SwitchD域名为RG1的域,创建实例MSTI1和实例MSTI2
system-view
[Huawei]sysname SwitchA
[SwitchA]stp region-configuration
[SwitchA-mst-region]region-name RG1
[SwitchA-mst-region]instance 1 vlan 2 to 10
[SwitchA-mst-region]instance 2 vlan 11 to 20
[SwitchA-mst-region]active region-configuration
[SwitchA-mst-region]quit
system-view
[Huawei]sysname SwitchB
[SwitchB]stp region-configuration
[SwitchB-mst-region]region-name RG1
[SwitchB-mst-region]instance 1 vlan 2 to 10
[SwitchB-mst-region]instance 2 vlan 11 to 20
[SwitchB-mst-region]active region-configuration
[SwitchB-mst-region]quit
system-view
[Huawei]sysname SwitchC
[SwitchC]stp region-configuration
[SwitchC-mst-region]region-name RG1
[SwitchC-mst-region]instance 1 vlan 2 to 10
[SwitchC-mst-region]instance 2 vlan 11 to 20
[SwitchC-mst-region]active region-configuration
[SwitchC-mst-region]quit
system-view
[Huawei]sysname SwitchD
[SwitchD]stp region-configuration
[SwitchD-mst-region]region-name RG1
[SwitchD-mst-region]instance 1 vlan 2 to 10
[SwitchD-mst-region]instance 2 vlan 11 to 20
[SwitchD-mst-region]active region-configuration
[SwitchD-mst-region]quit
[SwitchA]stp instance 1 root primary
[SwitchB]stp instance 1 root secondary
[SwitchB]stp instance 2 root primary
[SwitchA]stp instance 2 root secondary
步骤 1配置实例MSTI1和MSTI2中将要被阻塞端口的路径开销值大于缺省值
[SwitchA]stp pathcost-standard legacy
[SwitchB]stp pathcost-standard legacy
[SwitchC]stp pathcost-standard legacy
[SwitchC]interface gigabitethernet 1/0/2
[SwitchC-GigabitEthernet1/0/2]stp instance 2 cost 20000
[SwitchC-GigabitEthernet1/0/2]quit
[SwitchD]stp pathcost-standard legacy
[SwitchD]interface gigabitethernet 1/0/2
[SwitchD-GigabitEthernet1/0/2]stp instance 1 cost 20000
[SwitchD-GigabitEthernet1/0/2]quit
步骤 1使能MSTP,并将与终端相连的端口设置为边缘端口
[SwitchA]stp enable
[SwitchB]stp enable
[SwitchC]stp enable
[SwitchD]stp enable
[SwitchC]interface gigabitethernet 1/0/1
[SwitchC-GigabitEthernet1/0/1]stp edged-port enable
[SwitchC-GigabitEthernet1/0/1]quit
#(可选)配置SwitchC的BPDU保护功能。
[SwitchC]stp bpdu-protection
[SwitchD]interface gigabitethernet 1/0/1
[SwitchD-GigabitEthernet1/0/1]stp edged-port enable
[SwitchD-GigabitEthernet1/0/1]quit
[SwitchD]stp bpdu-protection
步骤 1配置处于环网中的设备的二层转发功能
[SwitchA]vlan batch 2 to 20
[SwitchA]interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1]port link-type trunk
[SwitchA-GigabitEthernet1/0/1]port trunk allow-pass vlan 2 to 20
[SwitchA-GigabitEthernet1/0/1]quit
[SwitchA]interface Eth-Trunk 1
[SwitchA-Eth-Trunk1]trunkport gigabitethernet 1/0/2
[SwitchA-Eth-Trunk1]trunkport gigabitethernet 1/0/3
[SwitchA-Eth-Trunk1]port link-type trunk
[SwitchA-Eth-Trunk1]port trunk allow-pass vlan 2 to 20
[SwitchA-Eth-Trunk1]quit
[SwitchB]vlan batch 2 to 20
[SwitchB]interface gigabitethernet 1/0/1
[SwitchB-GigabitEthernet1/0/1]port link-type trunk
[SwitchB-GigabitEthernet1/0/1]port trunk allow-pass vlan 2 to 20
[SwitchB-GigabitEthernet1/0/1]quit
[SwitchB]interface Eth-Trunk 1
[SwitchB-Eth-Trunk1]trunkport gigabitethernet 1/0/2
[SwitchB-Eth-Trunk1]trunkport gigabitethernet 1/0/3
[SwitchB-Eth-Trunk1]port link-type trunk
[SwitchB-Eth-Trunk1]port trunk allow-pass vlan 2 to 20
[SwitchB-Eth-Trunk1]quit
[SwitchC]vlan batch 2 to 20
[SwitchC]interface gigabitethernet 1/0/1
[SwitchC-GigabitEthernet1/0/1]port link-type access
[SwitchC-GigabitEthernet1/0/1]port default vlan 2
[SwitchC-GigabitEthernet1/0/1]quit
[SwitchC]interface gigabitethernet 1/0/2
[SwitchC-GigabitEthernet1/0/2]port link-type trunk
[SwitchC-GigabitEthernet1/0/2]port trunk allow-pass vlan 2 to 20
[SwitchC-GigabitEthernet1/0/2]quit
[SwitchC]interface gigabitethernet 1/0/3
[SwitchC-GigabitEthernet1/0/3]port link-type trunk
[SwitchC-GigabitEthernet1/0/3]port trunk allow-pass vlan 2 to 20
[SwitchC-GigabitEthernet1/0/3]quit
[SwitchD]vlan batch 2 to 20
[SwitchD]interface gigabitethernet 1/0/1
[SwitchD-GigabitEthernet1/0/1]port link-type access
[SwitchD-GigabitEthernet1/0/1]port default vlan 11
[SwitchD-GigabitEthernet1/0/1]quit
[SwitchD]interface gigabitethernet 1/0/2
[SwitchD-GigabitEthernet1/0/2]port link-type trunk
[SwitchD-GigabitEthernet1/0/2]port trunk allow-pass vlan 2 to 20
[SwitchD-GigabitEthernet1/0/2]quit
[SwitchD]interface gigabitethernet 1/0/3
[SwitchD-GigabitEthernet1/0/3]port link-type trunk
[SwitchD-GigabitEthernet1/0/3]port trunk allow-pass vlan 2 to 20
[SwitchD-GigabitEthernet1/0/3]quit
1.1.1 检查配置结果
在网络计算稳定后,执行以下操作,验证配置结果。
[SwitchA] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING ROOT
0 Eth-Trunk1 DESI FORWARDING NONE
1 GigabitEthernet1/0/1 DESI FORWARDING ROOT
1 Eth-Trunk1 DESI FORWARDING NONE
2 GigabitEthernet1/0/1 DESI FORWARDING ROOT
2 Eth-Trunk1 ROOT FORWARDING NONE
在MSTI1中,由于SwitchA是根桥,SwitchA的端口Eth-Trunk1和GE1/0/1成为指定端口。在MSTI2中,SwitchA的端口GE1/0/1成为指定端口,端口Eth-Trunk1成为根端口。
[SwitchB] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/1 DESI FORWARDING ROOT
0 Eth-Trunk1 ROOT FORWARDING NONE
1 GigabitEthernet1/0/1 DESI FORWARDING ROOT
1 Eth-Trunk1 ROOT FORWARDING NONE
2 GigabitEthernet1/0/1 DESI FORWARDING ROOT
2 Eth-Trunk1 DESI FORWARDING NONE
在MSTI2中,由于SwitchB是根桥,SwitchB的端口Eth-Trunk1和GE1/0/1成为指定端口。在MSTI1中,SwitchB的端口GE1/0/1成为指定端口,端口Eth-Trunk1成为根端口。
[SwitchC] display stp interface gigabitethernet 1/0/3 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/3 ROOT FORWARDING NONE
1 GigabitEthernet1/0/3 ROOT FORWARDING NONE
2 GigabitEthernet1/0/3 ROOT FORWARDING NONE
[SwitchC] display stp interface gigabitethernet 1/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/2 DESI FORWARDING NONE
1 GigabitEthernet1/0/2 DESI FORWARDING NONE
2 GigabitEthernet1/0/2 ALTE DISCARDING NONE
SwitchC的端口GE1/0/3在MSTI1和MSTI2中为根端口。SwitchC的另一个端口GE1/0/2,在MSTI2中被阻塞,在MSTI1中被计算为指定端口。
[SwitchD] display stp interface gigabitethernet 1/0/3 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/3 ROOT FORWARDING NONE
1 GigabitEthernet1/0/3 ROOT FORWARDING NONE
2 GigabitEthernet1/0/3 ROOT FORWARDING NONE
[SwitchD] display stp interface gigabitethernet 1/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet1/0/2 ALTE DISCARDING NONE
1 GigabitEthernet1/0/2 ALTE DISCARDING NONE
2 GigabitEthernet1/0/2 DESI FORWARDING NONE
SwitchD的端口GE1/0/3在MSTI1和MSTI2中为根端口。SwitchD的另一个端口GE1/0/2,在MSTI1中被阻塞,在MSTI2中被计算为指定端口。