Prevent Spanning Tree Loops
A switch notices when a physical connection is broken by the absence of
Layer 1 electrical keepalives (Ethernet calls this a link beat). However, sometimes
a cable is intact enough to maintain keepalives, but not to pass data in
both directions. This is a unidirectional link.
Unidirectional Link Detection (UDLD)
UDLD detects a unidirectional link by sending periodic hellos out the interface.
It also uses probes, which must be acknowledged by the device on the
other end of the link. UDLD operates at Layer 2. The port is shut down if a
unidirectional link is found.
To enable UDLD on all fiber-optic interfaces, use this command:
Switch(config)#udld enable
Although this command is given at global configuration mode, it applies
only to fiber ports. To enable UDLD on nonfiber ports, give the same
command at interface config mode.
To disable UDLD on a specific fiber port, use this command:
Switch(config-if)#udld disable
To disable UDLD on a specific nonfiber port, use this command:
Switch(config-if)#no udld enable
To re-enable all interfaces shut by UDLD, use the following:
Switch#udld reset
To verify UDLD status, use the following:
Switch#show udld interface