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

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

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.

Note: This example was added in Release 7.0(3)I6(1).


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

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

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.

Note: This example was added in Release 7.0(3)I6(1).


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

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