This section provides a sample of configuring the re-routing function for the DHCP relay agent on a distributed gateway using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays/dhcp-relay/anycast-gw-reroute-enable |
Item |
Data |
Description |
---|---|---|
Whether to enable DHCP |
true |
Enable DHCP. |
Whether to enable the DHCP relay function |
true |
Enable the DHCP relay function. |
Interface name |
VBDIF26 |
Set the name of the interface enabled with the DHCP relay function to VLANIF3. |
Whether to enable the re-routing function for the DHCP relay agent on a distributed gateway. | true |
Enable the re-routing function for the DHCP relay agent on a distributed gateway. |
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <bd:bridge-domains xmlns:bd="urn:huawei:params:xml:ns:yang:huawei-bd" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="merge"> <bd:bridge-domain> <bd:id>26</bd:id> </bd:bridge-domain> </bd:bridge-domains> <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge"> <name>Vbdif26</name> <type xmlns:x="urn:ietf:params:xml:ns:yang:iana-if-type">x:propVirtual</type> </interface> </interfaces> <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp"> <dhcpv4-config> <enable>true</enable> <dhcp-relay-configuration> <dhcp-relays> <dhcp-relay xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge"> <interface-name>Vbdif26</interface-name> <enable>true</enable> <anycast-gw-reroute-enable>true</anycast-gw-reroute-enable> </dhcp-relay> </dhcp-relays> </dhcp-relay-configuration> </dhcpv4-config> </dhcp-config> </config> </edit-config> </rpc>
Sample of successful response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> <ok/> </rpc-reply>
Sample of failed response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="11"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays/dhcp-relay[interface-name='Vbdif26']/anycast-gw-reroute-enable</error-path> <error-message>parse rpc config error.(Invalid value in "anycast-gw-reroute-enable" element.).</error-message> </rpc-error> </rpc-reply>