234 CHAPTER 23: MSTP CONFIGURATION
To prevent this situation from happening, MSTP provides the root guard function 
to protect the root bridge. If the root guard function is enabled on a port, this port 
will keep playing the role of designated port on all MST instances. Once this port 
receives a configuration BPDU with a higher priority from an MST instance, it 
immediately sets that instance port to the listening state, without forwarding the 
packet (this is equivalent to disconnecting the link connected with this port). If the 
port receives no BPDUs with a higher priority within twice the forwarding delay, 
the port will revert to its original state.
n
It is recommended that you enable the root guard feature on your device.
Follow these steps to enable root guard:
Enabling Loop Guard By keeping receiving BPDUs from the upstream device, a device can maintain the 
state of the root port and other blocked ports. However, due to link congestion or 
unidirectional link failures, these ports may fail to receive BPDUs from the 
upstream device. In this case, the downstream device will reselect the port roles: 
those ports failed to receive upstream BPDUs will become designated ports and 
the blocked ports will transition to the forwarding state, resulting in loops in the 
switched network. The loop guard function can suppress the occurrence of such 
loops.
If a loop guard-enabled port fails to receive BPDUs from the upstream device, and 
if the port took part in STP calculation, all the instances on the port, no matter 
what roles they play, will be set to, and stay in, the Discarding state.
n
It is recommended that you enable the loop guard feature on your device.
Follow these steps to enable loop guard:
To do… Use the command…  Remarks 
Enter system view system-view - 
Enter Ethernet 
interface view 
or port group 
view 
Enter Ethernet 
interface view 
interface interface-type 
interface-number 
Required
Use either command.
Configurations made in 
Ethernet interface view will 
take effect on the current 
port only; configurations 
made in port group view will 
take effect on all ports in the 
port group. 
Enter port 
group view 
port-group { manual 
port-group-name | 
aggregation agg-id }
Enable the root guard function 
on the port(s)
stp root-protection Required
Disabled by default
To do… Use the command…  Remarks 
Enter system view system-view -