Configuring Loop Protection on a Port
Context
On an RSTP network, a switching device maintains the states of the root port and blocked ports based on BPDUs received from an upstream switching device. If the switching device cannot receive BPDUs from the upstream because of link congestion or unidirectional-link failure, the switching device selects a new root port. The original root port becomes a designated port, and the original blocked ports change to the Forwarding state, which may cause loops on the network. To prevent this problem, configure loop protection.
If the root port or alternate port does not receive BPDUs from the upstream device for a specified period, a switch enabled with loop protection sends a notification to the NMS. If the root port is used, the root port enters the Discarding state and becomes the designated port. If the alternate port is used, the alternate port remains blocked and becomes the designated port. In this case, loops will not occur. After the link is no longer congested or unidirectional link failures are rectified, the port receives BPDUs for negotiation and restores its original role and status.
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 protection is enabled on the root port or alternate port.
By default, loop protection is disabled on a port.
An alternate port is a backup for a root port. If a switching device has an alternate port, configure loop protection on both the root port and the alternate port.
Root protection and loop protection cannot be configured on the same port.