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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
id | nw:IfId (base:IfIndex) | An identifier . | Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100 |
layer | l1:Layer (scalar:Enum8) | Administrative port layer | SELECTION: 1 - Layer2 2 - Layer3 DEFAULT: pltfmDfltLayer |
userCfgdFlags | l1:userCfgdFlags (scalar:Bitmask8) | Port User Config Flags | SELECTION: 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 Name | Data Type | Description | Values |
---|---|---|---|
switchportVirtualEthernetBridge | l1:SwitchportVirtualEthernetBridge (scalar:Enum8) | Disable/enable switchport virtual ethernet bridge on interface | SELECTION: 0 - disable 1 - enable DEFAULT: disable |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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:
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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
id | nw: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 Name | Data Type | Description | Values |
---|---|---|---|
switchportVirtualEthernetBridge | l1:SwitchportVirtualEthernetBridge (scalar:Enum8) | Disable/enable switchport virtual ethernet bridge on interface | SELECTION: 0 - disable 1 - enable DEFAULT: disable |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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:
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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
id | nw: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 Name | Data Type | Description | Values |
---|---|---|---|
switchportVirtualEthernetBridge | l1:SwitchportVirtualEthernetBridge (scalar:Enum8) | Disable/enable switchport virtual ethernet bridge on interface | SELECTION: 0 - disable 1 - enable DEFAULT: disable |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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:
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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
id | nw: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 Name | Data Type | Description | Values |
---|---|---|---|
switchportVirtualEthernetBridge | l1:SwitchportVirtualEthernetBridge (scalar:Enum8) | Disable/enable switchport virtual ethernet bridge on interface | SELECTION: 0 - disable 1 - enable DEFAULT: disable |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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:
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.
MO | DN |
---|---|
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 Name | Data Type | Description | Values |
---|---|---|---|
id | nw: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 Name | Data Type | Description | Values |
---|---|---|---|
switchportVirtualEthernetBridge | l1:SwitchportVirtualEthernetBridge (scalar:Enum8) | Disable/enable switchport virtual ethernet bridge on interface | SELECTION: 0 - disable 1 - enable DEFAULT: disable |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
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: