Configuring Loop Prevention on a Port
Context
On an RSTP network, a switch can only maintain the states of the root port and blocked ports if it is continuously receiving RST BPDUs from the upstream switch. If the ports cannot receive RST BPDUs from the upstream switch due to link congestion or unidirectional link failures, the switch re-selects a root port. The previous root port then becomes a designated port and the blocked ports change to the Forwarding state, potentially creating loops on the network. To prevent such a problem, configure loop protection.
With loop prevention enabled, if the root port or alternate port does not receive RST BPDUs from the upstream switch for a long time, the switch sends a notification to the NMS. The root port enters the Discarding state, whereas the blocked port remains in Blocking state and does not forward packets, preventing loops on the network. The root port or alternate port reverts to the Forwarding state after receiving new RST BPDUs.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The view of the root port or alternate port is displayed.
- Run stp loop-protection
Loop prevention is enabled on the root port or alternate port.
By default, loop prevention is disabled on a port.
An alternate port is a backup for a root port. If a device has an alternate port, configure loop prevention on both the root port and the alternate port.
Root protection and loop prevention cannot be configured on the same port.
- Run commit
The configuration is committed.