NETCONF Configuration Guide
...
Layer3
DHCP‑Relay
9 min
asternos dhcp relay this chapter provides examples on how to use netconf to manage dhcp relay configurations on asternos devices 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 note 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 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 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 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>
