Dhcp-Relay-Netconf
Dhcp Relay
Section titled “Dhcp Relay”Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /dhcp-relay | Y | merge, replace, create, delete | — |
| /dhcp-relay/dhcp-relay-agent/{name}/{ip-type} | Y | merge, replace, create, delete | — |
| /dhcp-relay/interfaces/{name} | Y | merge, replace, create, delete | — |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage DHCP Relay configurations on AsterNOS devices.
Get Current DHCP Relay Configurations
Section titled “Get Current DHCP Relay Configurations”Request example to get all DHCP Relay configurations via get-config with subtree filter.
<filter type="subtree"> <top> <dhcp-relay/> </top></filter>Response example
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <top> <dhcp-relay xmlns="http://asterfusion.com/ns/yang/asternos-dhcp-relay"> <dhcp-relay-agent> <name>test</name> <ip-type>v4</ip-type> <downlink-interfaces>Vlan100</downlink-interfaces> <uplink-interfaces>Ethernet1</uplink-interfaces> <loopback-interface>Loopback1</loopback-interface> <server-ips>10.1.1.1</server-ips> <server-ips>10.1.1.11</server-ips> <source-ip>10.2.2.2</source-ip> </dhcp-relay-agent> <interfaces> <name>Vlan100</name> <option82-remote-id>sonic</option82-remote-id> <dhcp-agent-ip>10.1.1.12</dhcp-agent-ip> </interfaces> </dhcp-relay> </top></data>Set DHCP Relay Configurations
Section titled “Set DHCP Relay Configurations”The up link, down link, loopback interface must be router interface and configured ip address.
Request example to set a DHCP Relay configuration via edit-config.
<config> <top> <dhcp-relay> <dhcp-relay-agent> <name>test</name> <ip-type>v4</ip-type> <downlink-interfaces>Vlan100</downlink-interfaces> <uplink-interfaces>Ethernet1</uplink-interfaces> <loopback-interface>Loopback1</loopback-interface> <server-ips>10.1.1.1</server-ips> <server-ips>10.1.1.11</server-ips> <source-ip>10.2.2.2</source-ip> </dhcp-relay-agent> </dhcp-relay> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:487ac1eb-4a86-4f44-bd6f-87a16ad92815"> <ok/></rpc-reply>Set DHCP Relay Agent IP configuration
Section titled “Set DHCP Relay Agent IP configuration”Request example to set a DHCP Relay Agent IP for down link interface via edit-config.
<config> <top> <dhcp-relay> <interfaces> <name>Vlan100</name> <dhcp-agent-ip>10.1.1.12</dhcp-agent-ip> </interfaces> </dhcp-relay> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:be7fefd9-98af-4153-9a86-cf82410e4676"> <ok/></rpc-reply>Set DHCP Relay Option82 for down link interface
Section titled “Set DHCP Relay Option82 for down link interface”Request example to set a DHCP Relay Option82 for down link interface via edit-config.
<config> <top> <dhcp-relay> <interfaces> <name>Vlan100</name> <option82-remote-id>sonic</option82-remote-id> </interfaces> </dhcp-relay> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a6096761-9460-480d-bac2-0d7727ddef90"> <ok/></rpc-reply>Delete DHCP Relay Configuration
Section titled “Delete DHCP Relay Configuration”Request example to delete DHCP Relay configurations of interface via edit-config.
<config> <top> <dhcp-relay> <dhcp-relay-agent operation="delete"> <name>test</name> <ip-type>v4</ip-type> </dhcp-relay-agent> </dhcp-relay> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:81c62129-0eed-4041-93a9-dd748f2c9dcf"> <ok/></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”DHCP relay
Section titled “DHCP relay”Tree Diagram
module: asternos-dhcp-relay +--rw dhcp-relay +--rw dhcp-relay-agent* [name ip-type] | +--rw name string | +--rw ip-type enumeration | +--rw downlink-interfaces* cmn:vlan-name | +--rw uplink-interfaces* union | +--rw loopback-interface? cmn:loopback-interface-name | +--rw option82-disabled? boolean | +--rw server-ips* inet:ip-address-no-zone | +--rw source-ip? inet:ipv4-address-no-zone +--rw interfaces* [name] +--rw name cmn:vlan-name +--rw option82-remote-id? string +--rw dhcp-agent-ip? inet:ipv4-address-no-zoneTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| dhcp-relay | M | Path-only node, has no configurable value. DHCP relay. | |
| dhcp-relay-agent | M | Path-only node, has no configurable value. The list of dhcp relay agent. | |
| name | O | None | DHCP relay name. |
| ip-type | O | ”v4" "v6” | DHCP relay IP family type. |
| downlink-interfaces | O | cmn:vlan-name | Downlink vlan interface |
| uplink-interfaces | O | Ethernet name | Uplink interface |
| loopback-interface | O | cmn:loopback-interface-name | Set loopback interface as DHCP relay gateway. |
| option82-disabled | O | ”true" "false” | Set DHCP Option82 enabled or disabled. |
| server-ips | O | inet:ip-address-no-zone | The IP address of DHCP server. |
| source-ip | O | inet:ipv4-address-no-zone | The IP address of DHCP relay agent. |
| interfaces | M | Path-only node, has no configurable value. List of Vlan interfaces configuration to the DHCP relay agent | |
| name | O | cmn:vlan-name | The VLAN interface name |
| option82-remote-id | O | string | The remote-id value of DHCP Option82 for DHCP relay agent. |
| dhcp-agent-ip | O | inet:ipv4-address-no-zone | The IP address of DHCP relay agent. |
The list of dhcp relay agent
Section titled “The list of dhcp relay agent”Tree Diagram
module: asternos-dhcp-relay +--rw dhcp-relay +--rw dhcp-relay-agent* [name ip-type] +--rw name string +--rw ip-type enumeration +--rw downlink-interfaces* cmn:vlan-name +--rw uplink-interfaces* union +--rw loopback-interface? cmn:loopback-interface-name +--rw option82-disabled? boolean +--rw server-ips* inet:ip-address-no-zone +--rw source-ip? inet:ipv4-address-no-zoneTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| dhcp-relay-agent | M | Path-only node, has no configurable value. The list of dhcp relay agent. | |
| name | O | None | DHCP relay name. |
| ip-type | O | ”v4" "v6” | DHCP relay IP family type. |
| downlink-interfaces | O | cmn:vlan-name | Downlink vlan interface |
| uplink-interfaces | O | Ethernet name | Uplink interface |
| loopback-interface | O | cmn:loopback-interface-name | Set loopback interface as DHCP relay gateway. |
| option82-disabled | O | ”true" "false” | Set DHCP Option82 enabled or disabled. |
| server-ips | O | inet:ip-address-no-zone | The IP address of DHCP server. |
| source-ip | O | inet:ipv4-address-no-zone | The IP address of DHCP relay agent. |
Interfaces
Section titled “Interfaces”Tree Diagram
module: asternos-dhcp-relay +--rw dhcp-relay +--rw interfaces* [name] +--rw name cmn:vlan-name +--rw option82-remote-id? string +--rw dhcp-agent-ip? inet:ipv4-address-no-zoneTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| interfaces | M | Path-only node, has no configurable value. List of Vlan interfaces configuration to the DHCP relay agent | |
| name | O | cmn:vlan-name | The VLAN interface name |
| option82-remote-id | O | string | The remote-id value of DHCP Option82 for DHCP relay agent. |
| dhcp-agent-ip | O | inet:ipv4-address-no-zone | The IP address of DHCP relay agent. |