Objective

Unidirectional Link Detection (UDLD) is a Layer 2 protocol that enables devices connected through fiber-optic or twisted-pair Ethernet cables to detect unidirectional links. A unidirectional link occurs whenever traffic from a neighboring device is received by the local device, but traffic from the local device is not received by the neighbor.

The purpose of UDLD is to detect ports on which the neighbor does not receive traffic from the local device (unidirectional link) and to shut down those ports. All connected devices must support UDLD for the protocol to successfully detect unidirectional links. If only the local device supports UDLD, it is not possible for the device to detect the status of the link. In this case, the status of the link is set to Undetermined. The user can configure whether ports in the Undetermined state are shut down or merely trigger notifications.

This article provides instructions on how to configure the UDLD settings on your switch through the Command Line Interface (CLI).

Applicable Devices

- Sx350 Series

- SG350X Series

- Sx550X Series

Software Version

- 2.3.5.63

Configure UDLD Settings

Configure UDLD Global Settings

Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.

Note: To learn how to access an SMB switch CLI through SSH or Telnet, click here.

Note: The commands may vary depending on the exact model of your switch. In this example, the SG550XG-8F8T switch is accessed through Telnet.

Step 2. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:

SG550XG-8F8T#configure

Step 3. To configure the global value of the interval between sending UDLD messages, enter the following:

SG550XG-8F8T(config)#udld message time [seconds]

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

Note: This configuration is relevant for both fiber and copper ports. The default value is 15 seconds. In this example, the interval is set to 60 seconds.

Step 4. To globally enable the UDLD protocol on the switch, enter the following:

SG550XG-8F8T(config)#udld [aggressive | normal]

- Normal — The switch shuts down an interface if the link is unidirectional. If the link is undetermined, a notification is issued.

- Aggressive — The switch shuts down an interface if the link is unidirectional. If the link is bi-directional, the switch shuts down after the UDLD information times out. The port state is marked as undetermined.

Note: This configuration is only relevant for fiber ports. The UDLD state of copper ports must be configured individually per interface. For instructions, skip to the Configure UDLD Interface Settings section.

Note: In this example, Normal is used.

Step 5. (Optional) To disable UDLD on the switch, enter the following:

SG550XG-8F8T(config)#udld

You should now have successfully configured the UDLD global settings on your switch through the CLI.

Configure UDLD Interface Settings

You can configure the UDLD interface settings of the switch to change the UDLD state for a specific port. This will allow you to configure the UDLD state for copper or fiber ports.

To configure UDLD for an interface, follow these steps:

Step 1. In the Global Configuration mode, enter the Interface Configuration context by entering the following:

SG550XG-8F8T(config)#interface [interface-id]

- interface-id — Specifies an Ethernet port ID.

Note: In this example, interface XG1/0/2 is used.

Step 2. To enable the UDLD protocol on an Ethernet port, enter the following:

SG550XG-8F8T(config)#udld port [normal | aggressive | disable]

- normal — The switch shuts down an interface if it detects that the link is unidirectional. It issues a notification if the link is undetermined.

- aggressive — The switch shuts down an interface if the link is unidirectional. If the link is bi-directional, the device shuts down after the UDLD information times out. The port state is marked as undetermined.

- disable — UDLD is disabled by default on all fiber ports of the device.

The default are as follows:

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

- Non-fiber interfaces are in the Disable state.

Note: In this example, the UDLD port is configured as aggressive.

Step 3. Enter the end command to go back to the Privileged EXEC mode of the switch:

SG550XG-8F8T(config-if)#end

You should now have successfully configured the UDLD interface settings on your switch through the CLI.

Step 4. (Optional) To display the administrative and operational UDLD status on the switch, enter the following:

SG550XG-8F8T#show udld [interface-id] [neighbors]

- interface-id — (Optional) Specifies an interface.

- neighbors — (Optional) Displays the neighbor information only.

Step 5. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file by entering the following:

SG550XG-8F8T#copy running-config startup-config

Step 6. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config].... prompt appears.

You should now have successfully configured the UDLD settings on your switch through the CLI.