UDLD Commands

This chapter contains the following sections:

show udld

To display the administrative and operational Unidirectional Link Detection Protocol (UDLD) status, use the show udld command in Privileged EXEC mode.

Syntax

show udld [interface-id] [neighbors]

Parameters

  • interface-id—Interface identifier of an Ethernet port.

  • neighbors—Displays neighbor information only.

Command Mode

Privileged EXEC mode

User Guidelines

If you do not enter an interface ID value, the administrative and operational UDLD status for all interfaces on which UDLD is enabled are displayed.

Examples

Example 1—This example shows how to display the UDLD state for all interfaces. Most of the fields shown in the display are self-explanatory. Those that are not self-explanatory are defined below.

switchxxxxxx# show udld
Global UDLD mode: normal
Message Time: 15 sec(default)
Interface gi1/0/1
  Port UDLD mode: aggressive
  Port Current state: Bidirectional
  Number of detected neighbors: 1
  Port Neighbor Table
    Neighbor Device ID: 1234567893
      Neighbor MAC: 00:00:01:22:33:dd
      Neighbor Device name: switch A
      Neighbor Port ID: gi1/2/1
      Neighbor Message Time: 20 sec
      Neighbor Current State: Bidirectional
      Neighbor Expiration Time: 7 sec
    Neighbor Device ID: 1234544893
      Neighbor MAC: 00:00:01:22:33:ff
      Neighbor Device name: switch A
      Neighbor Port ID: gi1/2/1
      Neighbor Message Time: 15 sec
      Neighbor Current State: Undetermined
      Neighbor Expiration Time: 17 sec
Interface gi1/0/2
  Port UDLD mode: normal (default)
  Port Current state: Undetermined
  Number of detected neighbors: 1
    Neighbor Device ID: 1234567753
      Neighbor MAC: 00:00:01:22:33:fe
      Neighbor Device name: switch A
      Neighbor Port ID: gi1/2/1
      Neighbor Message Time: 15 sec
      Neighbor Current State: Undetermined
      Neighbor Expiration Time: 11 sec
Interface gi1/0/3
  Port UDLD mode: disabled
Interface gi1/0/4
  Port UDLD mode: normal (default)
  Port Current state: shutdown
Field Descriptions:
  • Global UDLD mode—The global UDLD mode (normal or aggressive) configured by the udld command.

  • Message Time—The message time configured by the udld message time command.

  • Port UDLD mode—The interface UDLD mode (normal or aggressive).

  • Port Current state—The UDLD operational state: interface UDLD mode (normal or aggressive).

    • Disabled—UDLD is disabled on the port by the udld port disable command.

    • Shutdown—UDLD is enabled on the port and the port operational state is DOWN.

    • Detection—UDLD is detecting the link state.

    • Bidirectional—The link is bidirectional.

    • Undetermined—The link state is undetermined - no UDLD message has been received on the port.

  • Neighbor Device ID—The device ID of the neighbor.

  • Neighbor MAC—The MAC address of the neighbor.

  • Neighbor Device Name—The Device name of the neighbor.

  • Neighbor Port ID—The device port ID of the neighbor on which the recent UDLD message was sent.

  • Neighbor Message Time—The message time of the neighbor.

  • Neighbor Current State—The current state of the neighbor:

    Bidirectional—The UDLD messages received from the neighbor contain the Device ID and Port ID of the switch in the Echo TLV.

    Undetermined—The UDLD messages received from the neighbor do not contain the Device ID and Port ID of the switch in the Echo TLV.

  • Neighbor Expiration Time—Left time in seconds until the current neighbor state expires.

Example 2—This example shows how to display the UDLD state for one given interface:

switchxxxxxx# show udld gi1/0/1
Global UDLD mode: normal
Message Time: 15 sec(default)
Interface gi1/0/1
  Port UDLD mode: aggressive
  Port Current state: Bidirectional
  Number of detected neighbors: 1
  Port Neighbor Table
    Neighbor Device ID: 1234567893
      Neighbor MAC: 00:00:01:22:33:dd
      Neighbor Device name: switch A
      Neighbor Port ID: gi1/2/1
      Neighbor Message Time: 20 sec
      Neighbor Current State: Bidirectional
      Neighbor Expiration Time: 7 sec
    Neighbor Device ID: 1234544893
      Neighbor MAC: 00:00:01:22:33:ff
      Neighbor Device name: switch A
      Neighbor Port ID: gi1/2/1
      Neighbor Message Time: 15 sec
      Neighbor Current State: Undetermined
      Neighbor Expiration Time: 17 sec

Example 3—This example shows how to display neighbor information only:

switchxxxxxx# show udld neighbors
Port      Device ID     Port-ID   Device Name     Message    Neighbor     Expiration
                                            Time(sec) State       Time (sec)
-------- -------------- --------- --------------- ---------  ----------   ---------
gi1/0/1  1234567893     gi1/0/1   SAL0734K5R2        15      Bidirect          11
gi1/0/2  3456750193     gi1/0/2   SAL0734K5R3        20      Undetermined      5

Example 4—This example shows how to display neighbor information only for a single interface:

switchxxxxxx# show udld gi1/0/1 neighbors
Port      Device ID     Port-ID   Device Name     Message    Neighbor     Expiration
                                            Time(sec) State       Time (sec)
-------- -------------- --------- --------------- ---------  ----------   ---------
gi1/0/1  1234567893    gi1/0/1   SAL0734K5R2        15      Bidirect          11

udld

Use the udld command in Global Configuration mode to globally enable the UniDirectional Link Detection (UDLD) protocol. To disable UDLD, use the no form of this command.

Syntax

udld aggressive | normal

no udld

Parameters

  • aggressive—Enables UDLD in aggressive mode by default on all fiber interfaces.

  • normal—Enables UDLD in normal mode by default on all fiber interfaces.

Default Configuration

UDLD is disabled on all fiber interfaces.

Command Mode

Global Configuration mode

User Guidelines

This command affects fiber interfaces only. Use the udld port command in Interface Configuration mode to enable UDLD on other interface types.

Use the no form of this command to disable UDLD on all fiber ports.

The device supports the UDLD protocol specified by RFC 5171.

UDLD supports two modes of operation: normal and aggressive. In the aggressive mode the device shuts down a port if it cannot explicitly detect that the link is bidirectional. In the normal mode the device shuts down an interface if it explicitly detect that the link is unidirectional. A unidirectional link occurs whenever traffic sent by a local device is received by its neighbor but traffic from the neighbor is not received by the local device.

You can use the following commands to reset an interface shut down by UDLD:

  • The errdisable recover reset command with the interface interface-id parameter to reset a given interface.

  • The errdisable recover reset command with the udld parameter to reset all interfaces shut down by UDLD.

  • The errdisable recover cause with the udld parameter to automatically recover from the UDLD error-disabled state.

Example

This example shows how to enable UDLD on all fiber interfaces:

switchxxxxxx(config)# udld normal

udld message time

Use the udld message time command in Global Configuration mode to configure a global value of the interval between two sent probe messages. To return to the default value, use the no form of this command.

Syntax

udld message time seconds

no udld message time

Parameters

seconds—Interval between two sent probe messages. The valid values are from 1 to 90 seconds.

Default Configuration

15 seconds.

Command Mode

Global Configuration mode

User Guidelines

Use this command to change the default value of the message interval - the interval between two sequential sent probe messages.

Example

This example shows how to globally set the interval to 40sec:

switchxxxxxx(config)# udld message time 40

udld port

To enable the UDLD protocol on an Ethernet port, use the udld port command in Interface Configuration mode. To return to the default, use the no form of this command.

Syntax

udld port [aggressive | normal | disable]

no udld port

Parameters

  • aggressive—Enables UDLD in aggressive mode on this interface.

  • normal—Enables UDLD in normal mode on this interface. The normal keyword is applied if no keyword is specified.

  • disable—Disables UDLD on this interface.

Default Configuration

The defaults are as follows:

  • Fiber interfaces are in the state configured by the udld command.

  • Non-fiber interfaces are in the Disable state.

Command Mode

Interface (Ethernet) Configuration mode

User Guidelines

Use this command on fiber ports to override the setting of the global udld command.

If the port changes from fiber to non-fiber or vice versa, all configurations are maintained because the platform software detects a change of module or a Gigabit Interface Converter (GBIC) change.

Examples

Example 1—This example shows how to enable UDLD in normal mode on an Ethernet port regardless of the current global udld setting:

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# udld port normal
switchxxxxxx(config-if)# exit

Example 2—This example shows how to return to the default configuration:

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# no udld port
switchxxxxxx(config-if)# exit

Example 3—This example shows how to disable UDLD on an Ethernet port regardless of the current global udld setting:

switchxxxxxx(config)# interface gi1/0/1
switchxxxxxx(config-if)# udld port disable
switchxxxxxx(config-if)# exit