Configuring and Disabling DHCPv4 Relay
You can configure the device to run a DHCP relay agent, which forwards DHCP packets between clients and servers. This feature is useful when clients and servers are not on the same physical subnet. Relay agents receive DHCP messages and then generate a new DHCP message to send out on another interface. The relay agent sets the gateway address (giaddr field of the DHCP packet) and, if configured, adds the relay agent information option (Option 82) in the packet and forwards it to the DHCP server. The reply from the server is forwarded back to the client after removing Option 82. After you enable Option 82, the device uses the binary ifindex format by default. If needed, you can change the Option 82 setting to use an encoded string format instead.
Note When the device relays a DHCP request that already includes Option 82 information, the device forwards the request with the original Option 82 information without altering it.
This section contains payload examples and CLIs to demonstrate how to use the NX-API REST API to configure DHCPv4 relay on Cisco Nexus 3000 and 9000 Series switches and to show how the REST APIs correspond to the CLI commands. For more information, see the Cisco Nexus 9000 Series NX-OS Security Configuration Guide.
Configuring DHCPv4 Relay
Configuring DHCPv4 Relay
POST http://<IP_Address>/api/mo/sys/dhcp.json
{
"dhcpEntity": {
"children": [
{
"dhcpInst": {
"attributes": {
"v4RelayEnabled": "yes"
}}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<v4RelayEnabled>true</v4RelayEnabled>
</inst-items>
</dhcp-items>
</System>
Enables DHCPv4 and disables DHCPv6.
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
ip dhcp relay
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 |
---|---|
dhcpEntity | sys/dhcp |
dhcpInst | sys/dhcp/inst |
dhcpInst Properties
The following table contains information about the dhcpInst 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 |
---|---|---|---|
v4RelayEnabled | scalar:Bool | DHCPv4 Enabled | SELECTION: true or false |
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 DHCPv4 Relay
Disabling DHCPv4 Relay
POST http://<IP_Address>/api/mo/sys/dhcp.json
{
"dhcpEntity": {
"children": [
{
"dhcpInst": {
"attributes": {
"v4RelayEnabled": "no"
}}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<v4RelayEnabled>false</v4RelayEnabled>
</inst-items>
</dhcp-items>
</System>
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
no ip dhcp relay
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 |
---|---|
dhcpEntity | sys/dhcp |
dhcpInst | sys/dhcp/inst |
dhcpInst Properties
The following table contains information about the dhcpInst 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 |
---|---|---|---|
v4RelayEnabled | scalar:Bool | DHCPv4 Enabled | SELECTION: true or false |
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 the DHCP Relay Agent Suboption Format String
Configuring the DHCP Relay Agent Suboption Format String
POST http://<mgmt0_IP>/api/mo/sys/dhcp.json
{
"dhcpEntity": {
"children": [
{
"dhcpInst": {
"attributes": {
"RelaySubOptionCircuitIdFormatString": "format-string"
}}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<RelaySubOptionCircuitIdFormatString>format-string</RelaySubOptionCircuitIdFormatString>
</inst-items>
</dhcp-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.
ip dhcp relay sub-option circuit-id format-type string format format-string
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 |
---|---|
dhcpEntity | sys/dhcp |
dhcpInst | sys/dhcp/inst |
dhcpInst Properties
The following table contains information about the dhcpInst 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 |
---|---|---|---|
RelaySubOptionCircuitIdFormatString | string:Basic | Relay Sub-Option Circuit-id Format String | A sequence of characters |
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:
Deleting the DHCP Relay Agent Suboption Format String
Deleting the DHCP Relay Agent Suboption Format String
POST http://<mgmt0_IP>/api/mo/sys/dhcp.json
{
"dhcpEntity": {
"children": [
{
"dhcpInst": {
"attributes": {
"RelaySubOptionCircuitIdFormatString": ""
}}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<RelaySubOptionCircuitIdFormatString></RelaySubOptionCircuitIdFormatString>
</inst-items>
</dhcp-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.
no ip dhcp relay sub-option circuit-id format-type string format format-string
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 |
---|---|
dhcpEntity | sys/dhcp |
dhcpInst | sys/dhcp/inst |
dhcpInst Properties
The following table contains information about the dhcpInst 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 |
---|---|---|---|
RelaySubOptionCircuitIdFormatString | string:Basic | Relay Sub-Option Circuit-id Format String | A sequence of characters |
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 an IP Address for a DHCP Server
Configuring an IP Address for a DHCP Server
POST http://<IP_Address>/api/mo/sys/dhcp/inst.json
{
"dhcpInst": {
"children": [
{
"dhcpRelayIf": {
"attributes": {
"id": "eth1/1"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "128.66.0.0",
"counter": "2",
"vrf": "!unspecified"
}}}]}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<relayif-items>
<RelayIf-list>
<id>eth1/1</id>
<addr-items>
<RelayAddr-list>
<vrf>!unspecified</vrf>
<address>128.66.0.0</address>
<counter>2</counter>
</RelayAddr-list>
</addr-items>
</RelayIf-list>
</relayif-items>
</inst-items>
</dhcp-items>
</System>
Configures an IP address for a DHCP server to which the relay agent forwards BOOTREQUEST packets received on this interface.
This configuration requires two POSTs, one for the parent (the interface where the config will be applied) and one for the child (the address and VRF).
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
interface ethernet 1/1
ip dhcp relay address 128.66.0.0 use-vrf default
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 |
---|---|
dhcpInst | sys/dhcp/inst |
dhcpRelayIf | sys/dhcp/inst/relayif-{[id]} |
dhcpRelayAddr | sys/dhcp/inst/relayif-{[id]}/addr-{[vrf]}-{[address]} |
dhcpRelayIf Properties
The following table contains information about the dhcpRelayIf 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 |
dhcpRelayAddr Properties
The following table contains information about the dhcpRelayAddr 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 |
---|---|---|---|
address | address:Ip | Discovered IP address: switch will pick one address in case of dhcp client Configured relay address: multiple ip addresses as configured by the user FIXME IFC to give generic ip address | Value must match ipv4 or ipv6 known format |
counter | scalar:Uint16 | Counter | RANGE: [0, 65535] |
vrf | l3:VrfName (string:Basic) | vrf in which the dhcp server is present. Valid only when the client is in a different vrf from the server vrf | A sequence of characters |
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:
Deleting an IP Address for a DHCP Server
Deleting a Configured IP Address for a DHCP Server
POST http://<IP_Address>/api/mo/sys/dhcp/inst.json
{
"dhcpInst": {
"children": [
{
"dhcpRelayIf": {
"attributes": {
"id": "eth1/1"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "128.66.0.0",
"status": "deleted",
"vrf": "default"
}}}]}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<relayif-items>
<RelayIf-list>
<id>eth1/1</id>
<addr-items>
<RelayAddr-list xc:operation="delete">
<vrf>default</vrf>
<address>128.66.0.0</address>
</RelayAddr-list>
</addr-items>
</RelayIf-list>
</relayif-items>
</inst-items>
</dhcp-items>
</System>
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
interface ethernet 1/1
no ip dhcp relay address 128.66.0.0 use-vrf default
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 |
---|---|
dhcpInst | sys/dhcp/inst |
dhcpRelayIf | sys/dhcp/inst/relayif-{[id]} |
dhcpRelayAddr | sys/dhcp/inst/relayif-{[id]}/addr-{[vrf]}-{[address]} |
dhcpRelayIf Properties
The following table contains information about the dhcpRelayIf 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 |
dhcpRelayAddr Properties
The following table contains information about the dhcpRelayAddr 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 |
---|---|---|---|
address | address:Ip | Discovered IP address: switch will pick one address in case of dhcp client Configured relay address: multiple ip addresses as configured by the user FIXME IFC to give generic ip address | Value must match ipv4 or ipv6 known format |
status | mo:ModificationStatus (scalar:Bitmask32) | The upgrade status. This property is for internal use only. | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
vrf | l3:VrfName (string:Basic) | vrf in which the dhcp server is present. Valid only when the client is in a different vrf from the server vrf | A sequence of characters |
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 DHCP Relay on a Layer 3 Interface
Configuring DHCP Relay on a Layer 3 Interface
POST http://<mgmt0_IP>/api/mo/sys/dhcp/inst.json
{
"dhcpInst": {
"children": [
{
"dhcpRelayIf": {
"attributes": {
"id": "eth1/1"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "1.1.1.2",
"counter": "2",
"vrf": "!unspecified"
}}}]}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<relayif-items>
<RelayIf-list>
<id>eth1/1</id>
<addr-items>
<RelayAddr-list>
<vrf>!unspecified</vrf>
<address>1.1.1.2</address>
<counter>2</counter>
</RelayAddr-list>
</addr-items>
</RelayIf-list>
</relayif-items>
</inst-items>
</dhcp-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/1
ip dhcp relay address 1.1.1.2
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 |
---|---|
dhcpInst | sys/dhcp/inst |
dhcpRelayIf | sys/dhcp/inst/relayif-{[id]} |
dhcpRelayAddr | sys/dhcp/inst/relayif-{[id]}/addr-{[vrf]}-{[address]} |
dhcpRelayIf Properties
The following table contains information about the dhcpRelayIf 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 |
dhcpRelayAddr Properties
The following table contains information about the dhcpRelayAddr 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 |
---|---|---|---|
address | address:Ip | Discovered IP address: switch will pick one address in case of dhcp client Configured relay address: multiple ip addresses as configured by the user FIXME IFC to give generic ip address | Value must match ipv4 or ipv6 known format |
counter | scalar:Uint16 | Counter | RANGE: [0, 65535] |
vrf | l3:VrfName (string:Basic) | vrf in which the dhcp server is present. Valid only when the client is in a different vrf from the server vrf | A sequence of characters |
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:
Deleting DHCP Relay on a Layer 3 Interface
Deleting DHCP Relay on a Layer 3 Interface
POST http://<mgmt0_IP>/api/mo/sys/dhcp/inst.json
{
"dhcpInst": {
"children": [
{
"dhcpRelayIf": {
"attributes": {
"id": "eth1/1"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "1.1.1.2",
"status": "deleted",
"vrf": "!unspecified"
}}}]}}]}}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<relayif-items>
<RelayIf-list>
<id>eth1/1</id>
<addr-items>
<RelayAddr-list xc:operation="delete">
<vrf>!unspecified</vrf>
<address>1.1.1.2</address>
</RelayAddr-list>
</addr-items>
</RelayIf-list>
</relayif-items>
</inst-items>
</dhcp-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/1
no ip dhcp relay address 1.1.1.2
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 |
---|---|
dhcpInst | sys/dhcp/inst |
dhcpRelayIf | sys/dhcp/inst/relayif-{[id]} |
dhcpRelayAddr | sys/dhcp/inst/relayif-{[id]}/addr-{[vrf]}-{[address]} |
dhcpRelayIf Properties
The following table contains information about the dhcpRelayIf 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 |
dhcpRelayAddr Properties
The following table contains information about the dhcpRelayAddr 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 |
---|---|---|---|
address | address:Ip | Discovered IP address: switch will pick one address in case of dhcp client Configured relay address: multiple ip addresses as configured by the user FIXME IFC to give generic ip address | Value must match ipv4 or ipv6 known format |
status | mo:ModificationStatus (scalar:Bitmask32) | The upgrade status. This property is for internal use only. | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
vrf | l3:VrfName (string:Basic) | vrf in which the dhcp server is present. Valid only when the client is in a different vrf from the server vrf | A sequence of characters |
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 DHCP Relay on an SVI
Configuring DHCP Relay on an SVI
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"dhcpEntity": {
"children": [
{
"dhcpInst": {
"children": [
{
"dhcpRelayIf": {
"attributes": {
"id": "vlan10"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "1.1.1.2",
"counter": "2",
"vrf": "!unspecified"
}
}
}
]
}
}
]
}
}
]
}
},
{
"interfaceEntity": {
"children": [
{
"sviIf": {
"attributes": {
"id": "vlan10"
}
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<relayif-items>
<RelayIf-list>
<id>vlan10</id>
<addr-items>
<RelayAddr-list>
<vrf>!unspecified</vrf>
<address>1.1.1.2</address>
<counter>2</counter>
</RelayAddr-list>
</addr-items>
</RelayIf-list>
</relayif-items>
</inst-items>
</dhcp-items>
<intf-items>
<svi-items>
<If-list>
<id>vlan10</id>
</If-list>
</svi-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 vlan 10
ip dhcp relay address 1.1.1.2
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 |
---|---|
topSystem | sys |
dhcpEntity | sys/dhcp |
dhcpInst | sys/dhcp/inst |
dhcpRelayIf | sys/dhcp/inst/relayif-{[id]} |
dhcpRelayAddr | sys/dhcp/inst/relayif-{[id]}/addr-{[vrf]}-{[address]} |
interfaceEntity | sys/intf |
sviIf | sys/intf/svi-{[id]} |
dhcpRelayIf Properties
The following table contains information about the dhcpRelayIf 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 |
dhcpRelayAddr Properties
The following table contains information about the dhcpRelayAddr 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 |
---|---|---|---|
address | address:Ip | Discovered IP address: switch will pick one address in case of dhcp client Configured relay address: multiple ip addresses as configured by the user FIXME IFC to give generic ip address | Value must match ipv4 or ipv6 known format |
counter | scalar:Uint16 | Counter | RANGE: [0, 65535] |
vrf | l3:VrfName (string:Basic) | vrf in which the dhcp server is present. Valid only when the client is in a different vrf from the server vrf | A sequence of characters |
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 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 |
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:
Deleting DHCP Relay From an SVI
Deleting DHCP Relay From an SVI
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"dhcpEntity": {
"children": [
{
"dhcpInst": {
"children": [
{
"dhcpRelayIf": {
"attributes": {
"id": "vlan10"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "1.1.1.2",
"status": "deleted",
"vrf": "!unspecified"
}
}
}
]
}
}
]
}
}
]
}
},
{
"interfaceEntity": {
"children": [
{
"sviIf": {
"attributes": {
"id": "vlan10"
}
}
}
]
}
}
]
}
}
{
imdata:[]
}
<System>
<dhcp-items>
<inst-items>
<relayif-items>
<RelayIf-list>
<id>vlan10</id>
<addr-items>
<RelayAddr-list xc:operation="delete">
<vrf>!unspecified</vrf>
<address>1.1.1.2</address>
</RelayAddr-list>
</addr-items>
</RelayIf-list>
</relayif-items>
</inst-items>
</dhcp-items>
<intf-items>
<svi-items>
<If-list>
<id>vlan10</id>
</If-list>
</svi-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 vlan 10
no ip dhcp relay address 1.1.1.2
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 |
---|---|
topSystem | sys |
dhcpEntity | sys/dhcp |
dhcpInst | sys/dhcp/inst |
dhcpRelayIf | sys/dhcp/inst/relayif-{[id]} |
dhcpRelayAddr | sys/dhcp/inst/relayif-{[id]}/addr-{[vrf]}-{[address]} |
interfaceEntity | sys/intf |
sviIf | sys/intf/svi-{[id]} |
dhcpRelayIf Properties
The following table contains information about the dhcpRelayIf 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 |
dhcpRelayAddr Properties
The following table contains information about the dhcpRelayAddr 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 |
---|---|---|---|
address | address:Ip | Discovered IP address: switch will pick one address in case of dhcp client Configured relay address: multiple ip addresses as configured by the user FIXME IFC to give generic ip address | Value must match ipv4 or ipv6 known format |
status | mo:ModificationStatus (scalar:Bitmask32) | The upgrade status. This property is for internal use only. | SELECTION: 2 - created 4 - modified 8 - deleted 16 - replaced |
vrf | l3:VrfName (string:Basic) | vrf in which the dhcp server is present. Valid only when the client is in a different vrf from the server vrf | A sequence of characters |
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 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 |
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: