Configuring Tunnel Interfaces
This section contains payload examples to demonstrate how to use the NX-API REST API to configure tunnel interfaces for the Cisco Nexus 3000 and 9000 Series switches.
Enabling Tunneling
Enabling Tunneling
POST http://<IP_Address>/api/node/mo/sys/fm.json
{
"fmEntity": {
"children": [
{
"fmTunnelif": {
"attributes": {
"adminSt": "enabled"
}}}]}}
{
imdata:[]
}
<System>
<fm-items>
<tunnelif-items>
<adminSt>enabled</adminSt>
</tunnelif-items>
</fm-items>
</System>
Enabling feature tunnel.
CLI Command
The CLI command below is the equivalent to the payload example 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.
feature tunnel
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 |
---|---|
fmEntity | sys/fm |
fmTunnelif | sys/fm/tunnelif |
fmTunnelif Properties
The following table contains information about the fmTunnelif 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 |
---|---|---|---|
adminSt | fm:AdminState (scalar:Enum8) | Admin status | SELECTION: 1 - enabled 2 - disabled DEFAULT: disabled |
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:
Configuring Tunnel Interface - decapsulate-any
Configuring Tunnel Interface - decapsulate-any
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{
"interfaceEntity": {
"children": [
{
"tunnelifIf": {
"attributes": {
"id": "tunnel2",
"tunMode": "ipv6ipv6/dcapany"
}}}]}}
{
imdata:[]
}
<System>
<intf-items>
<tunnelif-items>
<If-list>
<id>tunnel2</id>
<tunMode>ipv6ipv6/dcapany</tunMode>
</If-list>
</tunnelif-items>
</intf-items>
</System>
Supports IPv6 payloads over IPv6 transport (IPv6inIPv6 packets) ( 7.0(3)I6(1) and later). This step is applicable for IPv6 networks only.
Note: This command is not supported on Cisco Nexus 9500 Series switches.
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 tunnel2
tunnel mode ipv6ipv6 decapsulate-any
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 |
tunnelifIf | sys/intf/tunnelif-{[id]} |
tunnelifIf Properties
The following table contains information about the tunnelifIf 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 |
tunMode | tunnelif:TunnelMode (scalar:Enum8) | Tunnel Mode | SELECTION: 1 - gre/ip 6 - gre/ipv6 7 - ipip/ip 8 - ipip/ipv6 9 - ipip/dcapany/ip 10 - ipip/dcapany/ipv6 11 - ipv6ip 12 - ipv6ip/dcapany 13 - ipv6ipv6 14 - ipv6ipv6/dcapany DEFAULT: gre/ip |
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:
Configuring Tunnel Interface - source direct
Configuring Tunnel Interface - source direct
POST http://<mgmt0_IP>/api/mo/sys/intf.json
{
"interfaceEntity": {
"children": [
{
"tunnelifIf": {
"attributes": {
"id": "tunnel2",
"tunSrcAddr": "0.0.0.0",
"tunSrcDirect": "enabled",
"tunSrcIntf": "unspecified"
}}}]}}
{
imdata:[]
}
<System>
<intf-items>
<tunnelif-items>
<If-list>
<id>tunnel2</id>
<tunSrcAddr>0.0.0.0</tunSrcAddr>
<tunSrcDirect>enabled</tunSrcDirect>
<tunSrcIntf>unspecified</tunSrcIntf>
</If-list>
</tunnelif-items>
</intf-items>
</System>
Configures IP-in-IP tunnel decapsulation on any directly connected IP addresses. Beginning with Cisco NX-OS Release 7.0(3)I6(1), this option is now supported only when the IP-in-IP decapsulation is used to source route the packets through the network.
Note: This command is not supported on Cisco Nexus 9500 Series switches.
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 tunnel2
tunnel source direct
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 |
tunnelifIf | sys/intf/tunnelif-{[id]} |
tunnelifIf Properties
The following table contains information about the tunnelifIf 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 |
tunSrcAddr | address:Ip | Tunnel Source | Value must match ipv4 or ipv6 known format |
tunSrcDirect | tunnelif:TunnelSrcDirect (scalar:Enum8) | Tunnel Source | SELECTION: 1 - enabled 2 - disabled DEFAULT: disabled |
tunSrcIntf | nw:IfId (base:IfIndex) | Tunnel Source | Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100 |
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: