This section describes how to configure DHCP server detection using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-savi/savi/dhcp-snooping/snooping-global-enable/server-detect-enable |
Item |
Data |
Description |
---|---|---|
DHCP server detection |
true |
Enable DHCP server detection. |
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <hw-savi:dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp"> <hw-savi:dhcpv4-config> <hw-savi:enable>true</hw-savi:enable> </hw-savi:dhcpv4-config> </hw-savi:dhcp-config> <hw-savi:savi xmlns="urn:huawei:params:xml:ns:yang:huawei-savi"> <hw-savi:dhcp-snooping xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="merge"> <hw-savi:snooping-global-enable> <hw-savi:ipv4-enable>true</hw-savi:ipv4-enable> <hw-savi:server-detect-enable>true</hw-savi:server-detect-enable> </hw-savi:snooping-global-enable> </hw-savi:dhcp-snooping> </hw-savi:savi> </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="123"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message> Please enable DHCP snooping in the global view first.</error-message> <error-info>Error on node /huawei-savi:savi/dhcp-snooping/snooping-global-enable/server-detect-enable</error-info> </rpc-error> </rpc-reply>