Configuring Hairpin Forwarding

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
interfaceEntity sys/intf
pcAggrIf sys/intf/aggr-{[id]}
pcAggrIfExtended sys/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
interfaceEntity sys/intf
l1PhysIf sys/intf/phys-{[id]}
l1PhysIfExtended sys/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
interfaceEntity sys/intf
l1PhysIf sys/intf/phys-{[id]}
l1PhysIfExtended sys/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
interfaceEntity sys/intf
pcAggrIf sys/intf/aggr-{[id]}
pcAggrIfExtended sys/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
interfaceEntity sys/intf
pcAggrIf sys/intf/aggr-{[id]}
pcAggrIfExtended sys/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