Cisco Nexus 3000 and 9000 Series NX-API REST SDK User Guide and API Reference, Release 10.4(x) - Cisco DevNet (2024)

Enabling Hairpin Forwarding on a Switchport

Enabling Hairpin Forwarding on a Switchport
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{ "interfaceEntity": { "children": [ { "pcAggrIf": { "attributes": { "id": "po1234", "layer": "Layer2", "userCfgdFlags": "admin_layer" }, "children": [ { "pcAggrIfExtended": { "attributes": { "switchportVirtualEthernetBridge": "enable"}}}]}}]}}
{ imdata:[]}
<System> <intf-items> <aggr-items> <AggrIf-list> <id>po1234</id> <layer>Layer2</layer> <userCfgdFlags>admin_layer</userCfgdFlags> <aggrExtd-items> <switchportVirtualEthernetBridge>enable</switchportVirtualEthernetBridge> </aggrExtd-items> </AggrIf-list> </aggr-items> </intf-items></System>

Configures hairpin forwarding on a switchport. This is only compatible with the following switches:

  • N9K-C9364C
  • N9K-C92160YC-X
  • N9K-C9348GC-FXP
  • N9K-C93108TC-FX
  • N9K-C93180YC-FX
  • N9K-C92304QC
  • N9K-C9272Q
  • N9K-C9232C
  • N9K-C9236C
  • N9K-C92300YC
  • N9K-C93108TC-EX
  • N9K-C93180LC-EX
  • N9K-C93180YC-EX


CLI Commands

The CLI commands and options listed below are the equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

interface port-channel 1234
switchport
switchport virtual-ethernet-bridge

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
interfaceEntitysys/intf
pcAggrIfsys/intf/aggr-{[id]}
pcAggrIfExtendedsys/intf/aggr-{[id]}/aggrExtd


pcAggrIf Properties

The following table contains information about the pcAggrIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
layerl1:Layer
(scalar:Enum8)
Administrative port layerSELECTION:

1 - Layer2

2 - Layer3

DEFAULT: pltfmDfltLayer

userCfgdFlagsl1:userCfgdFlags
(scalar:Bitmask8)
Port User Config FlagsSELECTION:

0 - none

1 - admin_state

2 - admin_layer

4 - admin_router_mac

8 - admin_dce_mode

16 - admin_mtu

DEFAULT: none


pcAggrIfExtended Properties

The following table contains information about the pcAggrIfExtended properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
switchportVirtualEthernetBridgel1:SwitchportVirtualEthernetBridge
(scalar:Enum8)
Disable/enable switchport virtual ethernet bridge on interfaceSELECTION:

0 - disable

1 - enable

DEFAULT: disable


Related Documentation

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 Hairpin Forwarding for an Ethernet Interface

Enabling Hairpin Forwarding for an Ethernet Interface
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{ "interfaceEntity": { "children": [ { "l1PhysIf": { "attributes": { "id": "eth1/3" }, "children": [ { "l1PhysIfExtended": { "attributes": { "switchportVirtualEthernetBridge": "enable"}}}]}}]}}
{ imdata:[]}
<System> <intf-items> <phys-items> <PhysIf-list> <id>eth1/3</id> <physExtd-items> <switchportVirtualEthernetBridge>enable</switchportVirtualEthernetBridge> </physExtd-items> </PhysIf-list> </phys-items> </intf-items></System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

interface ethernet 1/3
switchport virtual-ethernet-bridge

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
interfaceEntitysys/intf
l1PhysIfsys/intf/phys-{[id]}
l1PhysIfExtendedsys/intf/phys-{[id]}/physExtd


l1PhysIf Properties

The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100


l1PhysIfExtended Properties

The following table contains information about the l1PhysIfExtended properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
switchportVirtualEthernetBridgel1:SwitchportVirtualEthernetBridge
(scalar:Enum8)
Disable/enable switchport virtual ethernet bridge on interfaceSELECTION:

0 - disable

1 - enable

DEFAULT: disable


Related Documentation

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 Hairpin Forwarding for an Ethernet Interface

Disabling Hairpin Forwarding for an Ethernet Interface
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{ "interfaceEntity": { "children": [ { "l1PhysIf": { "attributes": { "id": "eth1/3" }, "children": [ { "l1PhysIfExtended": { "attributes": { "switchportVirtualEthernetBridge": "disable"}}}]}}]}}
{ imdata:[]}
<System> <intf-items> <phys-items> <PhysIf-list> <id>eth1/3</id> <physExtd-items> <switchportVirtualEthernetBridge>disable</switchportVirtualEthernetBridge> </physExtd-items> </PhysIf-list> </phys-items> </intf-items></System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

interface ethernet 1/3
no switchport virtual-ethernet-bridge

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
interfaceEntitysys/intf
l1PhysIfsys/intf/phys-{[id]}
l1PhysIfExtendedsys/intf/phys-{[id]}/physExtd


l1PhysIf Properties

The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100


l1PhysIfExtended Properties

The following table contains information about the l1PhysIfExtended properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
switchportVirtualEthernetBridgel1:SwitchportVirtualEthernetBridge
(scalar:Enum8)
Disable/enable switchport virtual ethernet bridge on interfaceSELECTION:

0 - disable

1 - enable

DEFAULT: disable


Related Documentation

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 Hairpin Forwarding on a Port Channel

Enabling Hairpin Forwarding on a Port Channel
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{ "interfaceEntity": { "children": [ { "pcAggrIf": { "attributes": { "id": "po123" }, "children": [ { "pcAggrIfExtended": { "attributes": { "switchportVirtualEthernetBridge": "enable"}}}]}}]}}
{ imdata:[]}
<System> <intf-items> <aggr-items> <AggrIf-list> <id>po123</id> <aggrExtd-items> <switchportVirtualEthernetBridge>enable</switchportVirtualEthernetBridge> </aggrExtd-items> </AggrIf-list> </aggr-items> </intf-items></System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

interface ethernet 1/2
interface port-channel 123
switchport virtual-ethernet-bridge

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
interfaceEntitysys/intf
pcAggrIfsys/intf/aggr-{[id]}
pcAggrIfExtendedsys/intf/aggr-{[id]}/aggrExtd


pcAggrIf Properties

The following table contains information about the pcAggrIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100


pcAggrIfExtended Properties

The following table contains information about the pcAggrIfExtended properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
switchportVirtualEthernetBridgel1:SwitchportVirtualEthernetBridge
(scalar:Enum8)
Disable/enable switchport virtual ethernet bridge on interfaceSELECTION:

0 - disable

1 - enable

DEFAULT: disable


Related Documentation

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 Hair-Pin Forwarding on a Port Channel

Disabling Hairpin Forwarding on a Port Channel>
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{ "interfaceEntity": { "children": [ { "pcAggrIf": { "attributes": { "id": "po123" }, "children": [ { "pcAggrIfExtended": { "attributes": { "switchportVirtualEthernetBridge": "disable"}}}]}}]}}
{ imdata:[]}
<System> <intf-items> <aggr-items> <AggrIf-list> <id>po123</id> <aggrExtd-items> <switchportVirtualEthernetBridge>disable</switchportVirtualEthernetBridge> </aggrExtd-items> </AggrIf-list> </aggr-items> </intf-items></System>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

interface ethernet 1/2
interface port-channel 123
no switchport virtual-ethernet-bridge

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
interfaceEntitysys/intf
pcAggrIfsys/intf/aggr-{[id]}
pcAggrIfExtendedsys/intf/aggr-{[id]}/aggrExtd


pcAggrIf Properties

The following table contains information about the pcAggrIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100


pcAggrIfExtended Properties

The following table contains information about the pcAggrIfExtended properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
switchportVirtualEthernetBridgel1:SwitchportVirtualEthernetBridge
(scalar:Enum8)
Disable/enable switchport virtual ethernet bridge on interfaceSELECTION:

0 - disable

1 - enable

DEFAULT: disable


Related Documentation

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

Cisco Nexus 3000 and 9000 Series NX-API REST SDK User Guide and API Reference, Release 10.4(x) - Cisco DevNet (2024)

FAQs

What are the 2 modes of operation in which Nexus 9000 series switches can be configured? ›

The Nexus 9000 can be used in NXOS mode for traditional 3-tier architectures, Spine-Leaf (CLOS) architectures, or Generation 1 SDN solutions such as OpenFlow. In ACI mode the Nexus 9000 offers the industry's leading architecture for the next generation of data center networking.

What is the Python release supported on the Cisco Nexus 9000 series switches? ›

About the Python API

The Cisco Nexus 9000 Series switches support Python v2. 7.11 and v3. 7.3 in both interactive and noninteractive (script) modes and are available in the Guest Shell. Python is an easy to learn, powerful programming language.

What is the default password for Nexus 3000? ›

The default password is undefined. If you do not specify a password, the user might not be able to log in to the Cisco Nexus 3000 Series switch.

What operating system do Cisco Nexus series switches run on? ›

NX-OS is a network operating system for the Nexus-series Ethernet switches and MDS-series Fibre Channel storage area network switches made by Cisco Systems.

What are the features of Nexus 9000? ›

The Cisco 9000 switch series offers both modular (9500 switches) and fixed (9300 switches) 1,10, 40, and 100 Gigabit Ethernet (GE) configurations that deliver many benefits including architectural flexibility, programmability, scalability, high availability, energy efficiency and investment protection.

Can you stack 2 different model Cisco switches? ›

No. Only same product families and their sub families products can be stacked.

What is Cisco Nexus 9000 Series? ›

Build a highly secure, scalable, flexible next-generation automated data center.

What is difference between Cisco switch and Nexus switch? ›

In conclusion, the fundamental distinction between a Cisco Catalyst switch and a Cisco Nexus switch is that Catalyst switches run IOS while Nexus switches use NX-OS. For generating Ether channels, Catalyst switches support both LACP and PAGP, but Nexus switches only support LACP.

What is Cisco Nexus used for? ›

Nexus Switches provide a quick and dependable switching infrastructure aimed at giving users the high performance needed for the virtualized environment in next-generation data centers.

What is the default user of Nexus? ›

The default credentials for Cisco Nexus devices typically include a username of "admin" and a password of "admin" or "Cisco". However, it is highly recommended to change these default credentials to enhance security and prevent unauthorized access to the devices.

What is the default user pass for Nexus? ›

The default password for user admin in Nexus is admin123 .

What is the default admin user for Nexus? ›

x. Nexus Repository Manager 3 includes a default 'admin' Administrator user account. Versions before 3.17. 0 had the default password of this account set to admin123 by default.

Is Nexus a switch or router? ›

The Cisco Nexus series switches are modular and fixed port network switches designed for the data center.

What is the difference between IOS and NX-OS? ›

Unlike Cisco IOS, NX-OS doesn't share a single memory space, and it does support symmetric multiprocessing. It also allows preemptive multitasking, which allows a high priority process to get CPU time ahead of a lower priority process.

What is NX in networking? ›

(Learn how and when to remove this template message) NX technology, commonly known as NX or NoMachine, is a remote access and remote control computer software, allowing remote desktop access and maintenance of computers.

What are the two possible modes you can configure a port in switch? ›

A switch port can be in one of two modes: access and trunk. There are two ways a switch port can settle down into one of these two modes: static and dynamic. You can manually configure a switch port to be in the access or trunk mode in the static method.

What two types of operating systems are in use on a Cisco switch? ›

Networking Software (IOS and NX-OS) - Cisco.

What are two options performed by a Cisco switch? ›

  • forwarding frames with unknown destination IP addresses to the default gateway.
  • building a routing table that is based on the first IP address in the frame header.
  • examining the destination MAC address to add new entries to the MAC address table.
Jan 29, 2024

What are the two main forwarding methods used by Cisco switches? ›

Switches use one of the following forwarding methods for switching data between network ports: store-and-forward switching or cut-through switching.

Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 6118

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.