Configuring NAT on a VLAN Interface

Configuring Outside Nat Interface

Configuring Outside Nat Interface
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
      {
        "natEntity": {
          "children": [
            {
              "natInst": {
                "children": [
                  {
                    "natDom": {
                      "attributes": {
                        "name": "default"
                      },
                      "children": [
                        {
                          "natIf": {
                            "attributes": {
                              "id": "vlan1",
                              "natIf": "ip-nat-inside"
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "interfaceEntity": {
          "children": [
            {
              "sviIf": {
                "attributes": {
                  "id": "vlan1"
                }
              }
            }
          ]
        }
      }
    ]
  }
}
{
    imdata:[]
}
<System>
  <nat-items>
    <inst-items>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <if-items>
            <If-list>
              <id>vlan1</id>
              <natIf>ip-nat-inside</natIf>
            </If-list>
          </if-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </nat-items>
  <intf-items>
    <svi-items>
      <If-list>
        <id>vlan1</id>
      </If-list>
    </svi-items>
  </intf-items>
</System>

Note: This example was added in Release 9.3(1).


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 vlan 1
 ip nat inside


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
interfaceEntitysys/intf
natDomsys/nat/inst/dom-default
natEntitysys/nat
natInstsys/nat/inst
sviIfsys/intf/svi-[vlan1]


natDom Properties

The following table contains information about the natDom 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
name
naming:Name256
string:Basic
The name of the object. RANGE: Min: "1" Max: "128"


natIf Properties

The following table contains information about the natIf 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
natIfnat:NatTrafficDir
(scalar:Enum8)
NAT interface config inside/outsideSELECTION:
0 - ip-nat-invalid
1 - ip-nat-inside
2 - ip-nat-outside


sviIf Properties

The following table contains information about the sviIf 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


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

For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference: https://developer.cisco.com/media/dme/index.html

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

Deleting Outside Nat Interface

Deleting Outside Nat Interface
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
      {
        "natEntity": {
          "children": [
            {
              "natInst": {
                "children": [
                  {
                    "natDom": {
                      "attributes": {
                        "name": "default"
                      },
                      "children": [
                        {
                          "natIf": {
                            "attributes": {
                              "id": "vlan1",
                              "status": "deleted"
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "interfaceEntity": {
          "children": [
            {
              "sviIf": {
                "attributes": {
                  "id": "vlan1"
                }
              }
            }
          ]
        }
      }
    ]
  }
}
{
    imdata:[]
}
<System>
  <nat-items>
    <inst-items>
      <dom-items>
        <Dom-list>
          <name>default</name>
          <if-items>
            <If-list xc:operation="delete">
              <id>vlan1</id>
            </If-list>
          </if-items>
        </Dom-list>
      </dom-items>
    </inst-items>
  </nat-items>
  <intf-items>
    <svi-items>
      <If-list>
        <id>vlan1</id>
      </If-list>
    </svi-items>
  </intf-items>
</System>

Note: This example was added in Release 9.3(1).


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 vlan 1
 no ip nat outside


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
interfaceEntitysys/intf
natDomsys/nat/inst/dom-default
natEntitysys/nat
natIfsys/nat/inst/dom-default/if-[eth1/2]
natIfsys/nat/inst/dom-default/if-[po123]
natIfsys/nat/inst/dom-default/if-[vlan1]
natInstsys/nat/inst
sviIfsys/intf/svi-[vlan1]


natDom Properties

The following table contains information about the natDom 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
name
naming:Name256
string:Basic
The name of the object. RANGE: Min: "1" Max: "128"


natIf Properties

The following table contains information about the natIf 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
statusmo:ModificationStatus
(scalar:Bitmask32)
Modification statusSELECTION:
2 - created
4 - modified
8 - deleted
16 - replaced


sviIf Properties

The following table contains information about the sviIf 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


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

For detailed information about classes and attributes in the payload, see the NX-API DME Model Reference: https://developer.cisco.com/media/dme/index.html

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