Example for Configuring VBST
Networking Requirements
As shown in Figure 11-5, SwitchC and SwitchD (access switches) are dual-homed to SwitchA and SwitchB (aggregation switches) respectively. SwitchC transmits traffic from VLAN 10 and VLAN 20, and SwitchD transmits traffic from VLAN 20 and VLAN 30. A ring network is formed between the access layer and aggregation layer. The enterprise requires that service traffic in each VLAN be correctly forwarded and service traffic from different VLANs be load balanced to improve link use efficiency.
Configuration Roadmap
VBST can be used to eliminate loops between the access layer and aggregation layer and ensures that service traffic in each VLAN is correctly forwarded. In addition, traffic from different VLANs can be load balanced. The configuration roadmap is as follows:
- Configure Layer 2 forwarding on access and aggregation switches.
Configure basic VBST functions on SwitchA, SwitchB, SwitchC, and SwitchD. Perform the following operations so that a spanning tree shown in Figure 11-5 is formed through calculation:
- Configure SwitchA and SwitchB as the root bridge and secondary root bridge of VLAN 10 respectively, SwitchA and SwitchB as the root bridge and secondary root bridge of VLAN 20 respectively, and configure SwitchB and SwitchA as the root bridge and secondary root bridge of VLAN 30 respectively, to ensure root bridge reliability.
- Set a larger path cost for 10GE1/0/2 on SwitchC in VLAN 10 and VLAN 20 so that 10GE1/0/2 is blocked in spanning trees of VLAN 10 and VLAN 20, and set a larger path cost for 10GE1/0/2 on SwitchD in VLAN 20 and VLAN 30 so that 10GE1/0/2 is blocked in the spanning tree of VLAN 20 and VLAN 30.
Procedure
- Configure Layer 2 forwarding on switches of the ring network.
Create VLAN 10, VLAN 20, and VLAN 30 on SwitchA, SwitchB, SwitchC, and SwitchD.
# Create VLAN 10, VLAN 20, and VLAN 30 on SwitchA.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 10 20 30 [*SwitchA] commit
# Create VLAN 10, VLAN 20, and VLAN 30 on SwitchB.
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] vlan batch 10 20 30 [*SwitchB] commit
# Create VLAN 10 and VLAN 20 on SwitchC.
<HUAWEI> system-view [~HUAWEI] sysname SwitchC [*HUAWEI] commit [~SwitchC] vlan batch 10 20 [*SwitchC] commit
# Create VLAN 20 and VLAN 30 on SwitchD.
<HUAWEI> system-view [~HUAWEI] sysname SwitchD [*HUAWEI] commit [~SwitchD] vlan batch 20 30 [*SwitchD] commit
Add ports connected to the ring to VLANs.
# Add 10GE1/0/1 on SwitchA to VLAN 10, VLAN 20, and VLAN 30.
[~SwitchA] interface 10ge 1/0/1 [~SwitchA-10GE1/0/1] port link-type trunk [*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10 20 30 [~SwitchA-10GE1/0/1] undo port trunk allow-pass vlan 1 [*SwitchA-10GE1/0/1] quit [*SwitchA] commit
# Add 10GE1/0/2 on SwitchA to VLAN 20 and VLAN 30.
[~SwitchA] interface 10ge 1/0/2 [~SwitchA-10GE1/0/2] port link-type trunk [*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20 30 [*SwitchA-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchA-10GE1/0/2] quit [*SwitchA] commit
# Add 10GE1/0/3 on SwitchA to VLAN 10 and VLAN 20.
[~SwitchA] interface 10ge 1/0/3 [~SwitchA-10GE1/0/3] port link-type trunk [*SwitchA-10GE1/0/3] port trunk allow-pass vlan 10 20 [*SwitchA-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchA-10GE1/0/3] quit [*SwitchA] commit
# Add 10GE1/0/1 on SwitchB to VLAN 10, VLAN 20, and VLAN 30.
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] port link-type trunk [*SwitchB-10GE1/0/1] port trunk allow-pass vlan 10 20 30 [*SwitchB-10GE1/0/1] undo port trunk allow-pass vlan 1 [*SwitchB-10GE1/0/1] quit [*SwitchB] commit
# Add 10GE1/0/2 on SwitchB to VLAN 10 and VLAN 20.
[~SwitchB] interface 10ge 1/0/2 [~SwitchB-10GE1/0/2] port link-type trunk [*SwitchB-10GE1/0/2] port trunk allow-pass vlan 10 20 [*SwitchB-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchB-10GE1/0/2] quit [*SwitchB] commit
# Add 10GE1/0/3 on SwitchB to VLAN 20 and VLAN 30.
[~SwitchB] interface 10ge 1/0/3 [~SwitchB-10GE1/0/3] port link-type trunk [*SwitchB-10GE1/0/3] port trunk allow-pass vlan 20 30 [*SwitchB-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchB-10GE1/0/3] quit [*SwitchB] commit
# Add 10GE1/0/2 on SwitchC to VLAN 10 and VLAN 20.
[~SwitchC] interface 10ge 1/0/2 [~SwitchC-10GE1/0/2] port link-type trunk [*SwitchC-10GE1/0/2] port trunk allow-pass vlan 10 20 [*SwitchC-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchC-10GE1/0/2] quit [*SwitchC] commit
# Add 10GE1/0/3 on SwitchC to VLAN 10 and VLAN 20.
[~SwitchC] interface 10ge 1/0/3 [~SwitchC-10GE1/0/3] port link-type trunk [*SwitchC-10GE1/0/3] port trunk allow-pass vlan 10 20 [*SwitchC-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchC-10GE1/0/3] quit [*SwitchC] commit
# Add 10GE1/0/4 on SwitchC to VLAN 10 and GE1/0/5 to VLAN 20.
[~SwitchC] interface 10ge 1/0/4 [~SwitchC-10GE1/0/4] port link-type access [*SwitchC-10GE1/0/4] port default vlan 10 [*SwitchC-10GE1/0/4] quit [*SwitchC] interface 10ge 1/0/5 [*SwitchC-10GE1/0/5] port link-type access [*SwitchC-10GE1/0/5] port default vlan 20 [*SwitchC-10GE1/0/5] quit [*SwitchC] commit
# Add 10GE1/0/2 on SwitchD to VLAN 20 and VLAN 30.
[~SwitchD] interface 10ge 1/0/2 [~SwitchD-10GE1/0/2] port link-type trunk [*SwitchD-10GE1/0/2] port trunk allow-pass vlan 20 30 [*SwitchD-10GE1/0/2] undo port trunk allow-pass vlan 1 [*SwitchD-10GE1/0/2] quit [*SwitchD] commit
# Add 10GE1/0/3 on SwitchD to VLAN 20 and VLAN 30.
[~SwitchD] interface 10ge 1/0/3 [~SwitchD-10GE1/0/3] port link-type trunk [*SwitchD-10GE1/0/3] port trunk allow-pass vlan 20 30 [*SwitchD-10GE1/0/3] undo port trunk allow-pass vlan 1 [*SwitchD-10GE1/0/3] quit [*SwitchD] commit
# Add 10GE1/0/4 on SwitchD to VLAN 10 and 10GE1/0/5 to VLAN 30.
[~SwitchD] interface 10ge 1/0/4 [~SwitchD-10GE1/0/4] port link-type access [*SwitchD-10GE1/0/4] port default vlan 20 [*SwitchD-10GE1/0/4] quit [*SwitchD] interface 10ge 1/0/5 [*SwitchD-10GE1/0/5] port link-type access [*SwitchD-10GE1/0/5] port default vlan 30 [*SwitchD-10GE1/0/5] quit [*SwitchD] commit
- Configure basic VBST functions.
Configure switches on the ring network to work in VBST mode.
# Configure SwitchA to work in VBST mode.
[~SwitchA] stp mode vbst [*SwitchA] commit
# Configure SwitchB to work in VBST mode.
[~SwitchB] stp mode vbst [*SwitchB] commit
# Configure SwitchC to work in VBST mode.
[~SwitchC] stp mode vbst [*SwitchC] commit
# Configure SwitchD to work in VBST mode.
[~SwitchD] stp mode vbst [*SwitchD] commit
Configure the root bridge and secondary root bridge.
Configure the root bridge and secondary root bridge in VLAN 10.
# Configure SwitchA as the root bridge in VLAN 10.
[~SwitchA] stp vlan 10 root primary [*SwitchA] commit
# Configure SwitchB as the secondary root bridge in VLAN 10.
[~SwitchB] stp vlan 10 root secondary [*SwitchB] commit
Configure the root bridge and secondary root bridge in VLAN 20.
# Configure SwitchA as the root bridge in VLAN 20.
[~SwitchA] stp vlan 20 root primary [*SwitchA] commit
# Configure SwitchB as the secondary root bridge in VLAN 20.
[~SwitchB] stp vlan 20 root secondary [*SwitchB] commit
Configure the root bridge and secondary root bridge in VLAN 30.
# Configure SwitchB as the root bridge in VLAN 30.
[~SwitchB] stp vlan 30 root primary [*SwitchB] commit
# Configure SwitchA as the secondary root bridge in VLAN 30.
[~SwitchA] stp vlan 30 root secondary [*SwitchA] commit
Configure the path cost for a port in each VLAN so that the port can be blocked.
The path cost range depends on the algorithm. IEEE 802.1t standard is used as an example. Set the path costs of the ports to be blocked to 2000000.
All switches on the same network must use the same path cost calculation method.
# Set the path cost of GE1/0/2 on SwitchC to 2000000 in VLAN 10 and VLAN 20.
[~SwitchC] interface 10ge 1/0/2 [~SwitchC-10GE1/0/2] stp vlan 10 cost 2000000 [*SwitchC-10GE1/0/2] stp vlan 20 cost 2000000 [*SwitchC-10GE1/0/2] quit [*SwitchC] commit
# Set the path cost of GE1/0/2 on SwitchD to 2000000 in VLAN 20 and VLAN 30.
[~SwitchD] interface 10ge 1/0/2 [~SwitchD-10GE1/0/2] stp vlan 20 cost 2000000 [*SwitchD-10GE1/0/2] stp vlan 30 cost 2000000 [*SwitchD-10GE1/0/2] quit [*SwitchD] commit
Enable VBST to eliminate loops.
Enable VBST globally.
By default, VBST is enabled globally.
Run the display stp vlan vlan-id information command to check the VBST status. If VBST is disabled, run the undo stp vlan vlan-id disable command in the system view to enable VBST globally.
Enable VBST in a VLAN.
By default, VBST is enabled in a VLAN.
Run the display stp vlan vlan-id information command to check the VBST status. If the message "The protocol is disabled" is displayed, VBST is disabled in the VLAN. Run the undo stp vlan vlan-id disable command in the system view to enable VBST in the VLAN.
Enable VBST on a port.
By default, VBST is enabled on a Layer 2 Ethernet port.
Run the display stp interface interface-type interface-number command to check the VBST status on a port. If the message "The protocol is disabled" is displayed, VBST is disabled on the port. Run the undo stp vlan disable command in the interface view to enable VBST on the port.
- Verify the configuration.
After the configuration is complete and the network topology becomes stable, perform the following operations to verify the configuration.
# Run the display stp vlan bridge local command on SwitchA to check the STP working mode.
[~SwitchA] display stp vlan bridge local ------------------------------------------------------------------ VLANID BridgeID HelloTime MaxAge ForwardDelay Protocol ------------------------------------------------------------------ 10 32869.ac94-8400-df01 2 20 15 VBST 20 32970.ac94-8400-df01 2 20 15 VBST 30 33071.ac94-8400-df01 2 20 15 VBST ------------------------------------------------------------------
The preceding information shows that the VBST mode is used.
# Run the display stp vlan information brief command on SwitchA to check the port status.
[~SwitchA] display stp vlan information brief -------------------------------------------------------------------------------- VLANID Interface Role STPState Protection Cost Edged -------------------------------------------------------------------------------- 10 10GE1/0/1 DESI forwarding none 20000 disable 10 10GE1/0/3 DESI forwarding none 2000 disable 20 10GE1/0/1 DESI forwarding none 20000 disable 20 10GE1/0/2 DESI forwarding none 2000 disable 20 10GE1/0/3 DESI forwarding none 2000 disable 30 10GE1/0/1 ALTE discarding none 20000 disable 30 10GE1/0/2 ROOT forwarding none 2000 disable --------------------------------------------------------------------------------
The preceding information shows that SwitchA participates in spanning tree calculation in VLAN 10, VLAN 20, and VLAN 30. For example, SwitchA is the root bridge in VLAN 10 and VLAN 20, so 10GE1/0/1 and 10GE1/0/3 in VLAN 10 are selected as designated ports. 10GE1/0/1, 10GE1/0/2, and 10GE1/0/3 in VLAN 20 are selected as designated ports. SwitchA is the secondary root bridge in VLAN 30, so 10GE1/0/2 is selected as the root port and 10GE1/0/1 is selected as the designated port in VLAN 30.
# Run the display stp vlan 10 information command on SwitchA to check detailed information about VLAN 10.
[~SwitchA] display stp vlan 10 information VLAN 10 information: -------------------------------------------------------------------------------- Global information: Protocol Status : Enabled Bpdu-filter Default : Disabled Bpdu-protection : Disabled Tc-protection : Disabled Tc-protection Threshold : 1 Tc-protection Interval(s) : 10 Edged Port Default : Disabled Path Cost Standard : Dot1T Timer Factor : 3 Transit Limit : 6 Bridge ID : 10.ac94-8400-df01 Config Times : Hello 2s MaxAge 20s FwDly 15s MaxHop 20 Active Times : Hello 2s MaxAge 20s FwDly 15s MaxHop 20 Root ID/RPC : 10.ac94-8400-df01 / 0 RootPortId(InterfaceName) : 0.0 (This bridge is the root) Root Type : Primary Port information: Port ID : 5 Interface : 10GE1/0/1 STP State : Forwarding Port Role : Designated Port Port Priority : 128 Path Cost Standard : Dot1T Port Cost(Config/Active) : 0 / 20000 Desg. Bridge/Port : 10.ac94-8400-df01 / 128.5 Port Edged(Config/Active) : Default / Disabled Point-to-point(Config/Active) : Auto / True Transit Limit : 6 packets/hello Protection Type : None Port ID : 8 Interface : 10GE1/0/3 STP State : Forwarding Port Role : Designated Port Port Priority : 128 Path Cost Standard : Dot1T Port Cost(Config/Active) : 0 / 2000 Desg. Bridge/Port : 10.ac94-8400-df01 / 128.8 Port Edged(Config/Active) : Default / Disabled Point-to-point(Config/Active) : Auto / True Transit Limit : 6 packets/hello Protection Type : None --------------------------------------------------------------------------------
The preceding information shows that SwitchA is selected as the root bridge in VLAN 10 and 10GE1/0/1 and 10GE1/0/3 are selected as designated ports in Forwarding state.
# Run the display stp vlan information brief command on SwitchB, SwitchC, and SwitchD to check the port status.
[~SwitchB] display stp vlan information brief ------------------------------------------------------------------------------ VLANID Interface Role STPState Protection Cost Edged ------------------------------------------------------------------------------ 10 10GE1/0/1 ALTE discarding none 20000 disable 10 10GE1/0/2 ROOT forwarding none 2000 disable 20 10GE1/0/1 ALTE discarding none 20000 disable 20 10GE1/0/2 ROOT forwarding none 2000 disable 20 10GE1/0/3 DESI forwarding none 2000 disable 30 10GE1/0/1 DESI forwarding none 20000 disable 30 10GE1/0/3 DESI forwarding none 2000 disable ------------------------------------------------------------------------------
[~SwitchC] display stp vlan information brief ------------------------------------------------------------------------------ VLANID Interface Role STPState Protection Cost Edged ------------------------------------------------------------------------------ 10 10GE1/0/2 ROOT forwarding none 2000 disable 10 10GE1/0/3 DESI forwarding none 2000000 disable 10 10GE1/0/4 DESI forwarding none 2000 disable 20 10GE1/0/2 ROOT forwarding none 2000 disable 20 10GE1/0/3 DESI forwarding none 2000000 disable 20 10GE1/0/5 DESI forwarding none 2000 disable ------------------------------------------------------------------------------
[~SwitchD] display stp vlan information brief ------------------------------------------------------------------------------ VLANID Interface Role STPState Protection Cost Edged ------------------------------------------------------------------------------ 20 10GE1/0/2 ALTE discarding none 2000000 disable 20 10GE1/0/3 ROOT forwarding none 2000 disable 20 10GE1/0/4 DESI forwarding none 2000 disable 30 10GE1/0/2 DESI forwarding none 2000000 disable 30 10GE1/0/3 ROOT forwarding none 2000 disable 30 10GE1/0/5 DESI forwarding none 2000 disable ------------------------------------------------------------------------------
The preceding information shows that SwitchB participates in spanning tree calculation in VLAN 10, VLAN 20, and VLAN 30, SwitchC participates in spanning tree calculation in VLAN 10 and VLAN 20, and SwitchD participates in spanning tree calculation in VLAN 20 and VLAN 30. After the calculation is complete, ports are selected as different roles to eliminate loops.
Different spanning trees are formed in VLAN 10, VLAN 20, and VLAN 30, and traffic in VLAN 10, VLAN 20, and VLAN 30 is forwarded along different spanning trees to implement load balancing.
Configuration Files
Configuration file of SwitchA
# sysname SwitchA # stp vlan 30 root secondary stp vlan 10 20 root primary # vlan batch 10 20 30 # stp mode vbst # interface 10GE1/0/1 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 30 # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 # return
Configuration file of SwitchB
# sysname SwitchB # stp vlan 10 20 root secondary stp vlan 30 root primary # vlan batch 10 20 30 # stp mode vbst # interface 10GE1/0/1 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 30 # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 # return
Configuration file of SwitchC
# sysname SwitchC # vlan batch 10 20 # stp mode vbst # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 stp vlan 10 20 cost 2000000 # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 10 20 # interface 10GE1/0/4 port link-type access port default vlan 10 stp edged-port enable # interface 10GE1/0/5 port link-type access port default vlan 20 stp edged-port enable # return
Configuration file of SwitchD
# sysname SwitchD # vlan batch 20 30 # stp mode vbst # interface 10GE1/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 stp vlan 20 30 cost 2000000 # interface 10GE1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 20 30 # interface 10GE1/0/4 port link-type access port default vlan 20 stp edged-port enable # interface 10GE1/0/5 port link-type access port default vlan 30 stp edged-port enable # return