Configuring UDLD

UDLD is configured at global config level and/or under each interfaces. It monitors a physical connection to detect unidirectional links to avoid spanning-tree topology loops or silent drop traffic.

You can configure normal unidirectional link detection (UDLD) modes for Ethernet interfaces on devices configured to run UDLD.

Before you can enable a UDLD mode for an interface, you must make sure that UDLD is already enabled on the device that includes the interface. UDLD must also be enabled on the other linked interface and its device.

This section contains payload examples to demonstrate how to use the NX-API REST API to configure UDLD on the Cisco Nexus 3000 and 9000 Series switches.

Enabling UDLD

Enabling UDLD
POST http://<IP_Address>/api/node/mo/sys/fm.json
{
  "fmEntity": {
    "children": [
      {
        "fmUdld": {
          "attributes": {
            "adminSt": "enabled"
}}}]}}
{
    "imdata": []
}
<System>
  <fm-items>
    <udld-items>
      <adminSt>enabled</adminSt>
    </udld-items>
  </fm-items>
</System>

Enables UDLD for the device.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

feature udld

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Disabling UDLD

Disabling UDLD
POST http://<IP_Address>/api/node/mo/sys/fm.json
{
  "fmEntity": {
    "children": [
      {
        "fmUdld": {
          "attributes": {
            "adminSt": "disabled"
}}}]}}
{
    "imdata": []
}
<System>
  <fm-items>
    <udld-items>
      <adminSt>enabled</adminSt>
    </udld-items>
  </fm-items>
</System>

Disables UDLD for the device.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

no feature udld

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Enabling UDLD Aggressive Mode at the Global Level

Enabling UDLD Aggressive Mode at the Global Level
POST http://<IP_Address>/api/mo/sys/udld/inst.json
{
  "udldInst": {
     "attributes": {
        "aggressive": "enabled"
     }
   }
}
{
    "imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <aggressive>enabled</aggressive>
    </inst-items>
  </udld-items>
</System>

Enables UDLD aggressive mode at the global level.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

udld aggressive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Specifying UDLD Aggressive

Specifying UDLD Aggressive
POST http://<IP_Address>/api/node/mo/sys/udld/inst.json
{
"udldInst": {
    "attributes": {
        "adminSt": "enabled",
        "aggressive": "enabled",
        "childAction": "",
        "ctrl": "",
        "dn": "sys/udld/inst",
        "status": ""
}}}
{
    imdata": []
}

Enables UDLD in aggressive mode.

Note: For copper interfaces, you enter the interface command mode for those interfaces you want to configure for UDLD aggressive mode and issue this command in interface command model.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

udld aggressive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

No UDLD Aggressive

No UDLD Aggressive
POST http://<IP_Address>/api/node/mo/sys/udld/inst.json
{
    "udldInst": {
        "attributes": {
            "adminSt": "enabled",
            "aggressive": "disabled",
            "childAction": "",
            "ctrl": "",
            "dn": "sys/udld/inst",
            "status": ""
}}
{
    imdata": []
}

Disables aggressive mode UDLD.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

no udld aggressive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Enabling UDLD Aggressive at the Interface Level

Enabling UDLD Aggressive at the Interface Level
POST http://{{mgmt-ip}}/api/node/mo/sys/udld/inst.json
{
  "udldInst": {
    "children": [
      {
        "udldPhysIf": {
          "attributes": {
            "aggressive": "enabled",
            "biDirDetect": "port-default",
            "id": "eth1/8"
}}}]}}
{
    imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <physif-items>
        <PhysIf-list>
          <id>eth1/8</id>
          <aggressive>enabled</aggressive>
          <biDirDetect>port-default</biDirDetect>
        </PhysIf-list>
      </physif-items>
    </inst-items>
  </udld-items>
</System>

Enables UDLD aggressive for an ethernet interface.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

interface ethernet1/8
 udld aggressive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Disabling UDLD at the Interface Level

Disabling UDLD at the Interface Level
POST http://{{mgmt-ip}}/api/node/mo/sys/udld/inst.json
{
  "udldInst": {
    "children": [
      {
        "udldPhysIf": {
          "attributes": {
            "aggressive": "disabled",
            "id": "eth1/8"
}}}]}}
{
    imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <physif-items>
        <PhysIf-list>
          <id>eth1/8</id>
          <aggressive>disabled</aggressive>
        </PhysIf-list>
      </physif-items>
    </inst-items>
  </udld-items>
</System>

Disables UDLD aggressive for an interface.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

interface ethernet1/8
 no udld aggressive

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Enabling UDLD on Copper Ports

Enabling UDLD on Copper Ports
POST http://{{mgmt-ip}}/api/node/mo/sys/udld/inst.json
{
  "udldInst": {
    "children": [
      {
        "udldPhysIf": {
          "attributes": {
            "aggressive": "disabled",
            "biDirDetect": "port-enabled",
            "id": "eth1/8"
}}}]}}
{
    imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <physif-items>
        <PhysIf-list>
          <id>eth1/8</id>
          <aggressive>disabled</aggressive>
          <biDirDetect>port-enabled</biDirDetect>
        </PhysIf-list>
      </physif-items>
    </inst-items>
  </udld-items>
</System>

Enables UDLD on copper ports.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

uinterface ethernet1/8
 udld enable

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Enabling UDLD on Fiber Ports

Enabling UDLD on Fiber Ports
POST http://{{mgmt-ip}}/api/node/mo/sys/udld/inst.json
{
  "udldInst": {
    "children": [
      {
        "udldPhysIf": {
          "attributes": {
            "biDirDetect": "port-enabled",
            "id": "eth1/8"
}}}]}}
{
    imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <physif-items>
        <PhysIf-list>
          <id>eth1/8</id>
          <aggressive>disabled</aggressive>
          <biDirDetect>port-enabled</biDirDetect>
        </PhysIf-list>
      </physif-items>
    </inst-items>
  </udld-items>
</System>

Enables UDLD on fiber ports.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

uinterface ethernet1/8
 no udld enable

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Disabling UDLD on Fiber Port

Disabling UDLD on Fiber Ports
POST http://{{mgmt-ip}}/api/node/mo/sys/udld/inst.json
{
  "udldInst": {
    "children": [
      {
        "udldPhysIf": {
          "attributes": {
            "aggressive": "disabled",
            "biDirDetect": "port-fiber-disabled",
            "id": "eth1/8"
}}}]}
{
    imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <physif-items>
        <PhysIf-list>
          <id>eth1/8</id>
          <aggressive>disabled</aggressive>
          <biDirDetect>port-fiber-disabled</biDirDetect>
        </PhysIf-list>
      </physif-items>
    </inst-items>
  </udld-items>
</System>

Disables UDLD on fiber ports.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

interface ethernet1/8
 udld disable

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Enabling UDLD on Fiber Ports

Enabling UDLD on Fiber Ports
POST http://{{mgmt-ip}}/api/node/mo/sys/udld/inst.json
{
  "udldInst": {
    "children": [
      {
        "udldPhysIf": {
          "attributes": {
            "biDirDetect": "port-default",
            "id": "eth1/8"
}}}]}}
{
    imdata": []
}
<System>
  <udld-items>
    <inst-items>
      <physif-items>
        <PhysIf-list>
          <id>eth1/8</id>
          <biDirDetect>port-default</biDirDetect>
        </PhysIf-list>
      </physif-items>
    </inst-items>
  </udld-items>
</System>

Enables UDLD on fiber ports.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.

interface ethernet1/8
 no udld disable

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring UDLD for any Interface

Configuring UDLD for any Interface
POST http://<IP_Address>/api/mo/sys/udld/inst.json
{
"udldInst": {
    "children" : [{
        "udldPhysIf" : {
            "attributes" : {
                "id" : "eth1/2"
                    "aggressive": "2"
                    "biDirDetect": "0"
}}}]}}
{
    imdata": []
}

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html