Querying DHCP Relay Interfaces
Querying DHCP Relay Interfaces
GET http://<IP_Address>/api/mo/sys/dhcp/inst/relayif-[eth1/1].json?rsp-subtree=full
{
"totalCount": "1",
"imdata": [
{
"dhcpRelayIf": {
"attributes": {
"InformationTrustedEnabled": "no",
"SmartRelayEnabled": "no",
"SubnetBroadcastEnabled": "no",
"adminSt": "enabled",
"childAction": "",
"descr": "",
"dn": "sys/dhcp/inst/relayif-[eth1/1]",
"id": "eth1/1",
"modTs": "2018-07-06T20:44:48.559+00:00",
"monPolDn": "",
"name": "",
"options": "",
"persistentOnReload": "true",
"status": "",
"uid": "0"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "1.1.1.2",
"childAction": "",
"counter": "2",
"gw": "0.0.0.0",
"modTs": "2018-07-06T20:44:48.559+00:00",
"mode": "not-visible",
"persistentOnReload": "true",
"rn": "addr-[!unspecified]-[1.1.1.2]",
"status": "",
"uid": "0",
"vrf": "!unspecified"
}
}
}
]
}
}
]
}
GET http://<IP_Address>/api/mo/sys/dhcp/inst/relayif-[vlan10].json?rsp-subtree=full
{
"totalCount": "1",
"imdata": [
{
"dhcpRelayIf": {
"attributes": {
"InformationTrustedEnabled": "no",
"SmartRelayEnabled": "no",
"SubnetBroadcastEnabled": "no",
"adminSt": "enabled",
"childAction": "",
"descr": "",
"dn": "sys/dhcp/inst/relayif-[vlan10]",
"id": "vlan10",
"modTs": "2018-07-06T20:49:30.427+00:00",
"monPolDn": "",
"name": "",
"options": "",
"persistentOnReload": "true",
"status": "",
"uid": "0"
},
"children": [
{
"dhcpRelayAddr": {
"attributes": {
"address": "2.2.2.2",
"childAction": "",
"counter": "2",
"gw": "0.0.0.0",
"modTs": "2018-07-06T20:49:30.427+00:00",
"mode": "not-visible",
"persistentOnReload": "true",
"rn": "addr-[!unspecified]-[2.2.2.2]",
"status": "",
"uid": "0",
"vrf": "!unspecified"
}
}
}
]
}
}
]
}
GET http:/<IP_Address>/restconf/data/Cisco-NX-OS-device:System/dhcp-items/inst-items/relayif-items
<relayif-items>
<RelayIf-list>
<id>eth1/1</id>
<InformationTrustedEnabled>false</InformationTrustedEnabled>
<SmartRelayEnabled>false</SmartRelayEnabled>
<SubnetBroadcastEnabled>false</SubnetBroadcastEnabled>
<addr-items>
<RelayAddr-list>
<vrf>!unspecified</vrf>
<address>1.1.1.2</address>
<counter>2</counter>
<mode>not-visible</mode>
</RelayAddr-list>
</addr-items>
<adminSt>enabled</adminSt>
</RelayIf-list>
<RelayIf-list>
<id>vlan10</id>
<InformationTrustedEnabled>false</InformationTrustedEnabled>
<SmartRelayEnabled>false</SmartRelayEnabled>
<SubnetBroadcastEnabled>false</SubnetBroadcastEnabled>
<addr-items>
<RelayAddr-list>
<vrf>!unspecified</vrf>
<address>2.2.2.2</address>
<counter>2</counter>
<mode>not-visible</mode>
</RelayAddr-list>
</addr-items>
<adminSt>enabled</adminSt>
</RelayIf-list>
</relayif-items>
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output switch(config-if)# show ip dhcp relay address interface e1/1
Interface Relay Address VRF Name
------------- ------------- --------
Ethernet1/1 1.1.1.2
switch(config-if)# sh ip dhcp relay address interface vlan 10
Interface Relay Address VRF Name
------------- ------------- --------
Vlan10 2.2.2.2
Note: The property information for this example was added in Release 9.3(3).
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 InformationTrustedEnabled scalar:Bool Information Trusted Enabled SELECTION: true or false SmartRelayEnabled scalar:Bool Smart Relay Enabled SELECTION: true or false SubnetBroadcastEnabled scalar:Bool Subnet Broadcast Enabled SELECTION: true or false adminSt nw:IfAdminSt
(nw:AdminSt)The administrative state of the object or policy. SELECTION: childAction
mo:ModificationChildAction
scalar:Bitmask32Delete or ignore. For internal use only. SELECTION:
descr
naming:Descr1024
string:BasicAdditional descriptive information about the object. RANGE:
Min: "0"
Max: "1024" dn
reference:BinRefA tag or metadata is a non-hierarchical keyword or term assigned to the fabric module. id nw:IfId
(base:IfIndex)An identifier . Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100 modTs mo:TStamp
(scalar:Date)The time when this object was last modified. SELECTION: monPolDn
reference:BinRefThe monitoring policy attached to this observable object. name
naming:Name256
string:BasicThe name of the object. RANGE:
Min: "0"
Max: "128" options dhcp:Options
(scalar:Bitmask64)DHCP options SELECTION: persistentOnReload
mo:Persistent
scalar:Enum8NO COMMENTS SELECTION:
status mo:ModificationStatus
(scalar:Bitmask32)The upgrade status. This property is for internal use only. SELECTION: uid
scalar:Uint16A unique identifier for this object.
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 childAction
mo:ModificationChildAction
scalar:Bitmask32Delete or ignore. For internal use only. SELECTION:
counter scalar:Uint16 Counter RANGE: [0, 65535] gw
address:IpGateway IP address, valid only when we are crossing vrfs. Should always be present when client is crossing vrf to get its ip address modTs mo:TStamp
(scalar:Date)The time when this object was last modified. SELECTION: mode
dhcp:RelayVisibility
scalar:Enum8The BGP Domain mode. SELECTION:
persistentOnReload
mo:Persistent
scalar:Enum8NO COMMENTS SELECTION:
rn
reference:BinRNIdentifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names. status mo:ModificationStatus
(scalar:Bitmask32)The upgrade status. This property is for internal use only. SELECTION: uid
scalar:Uint16A unique identifier for this object. 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: