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

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

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

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

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

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