This section provides a sample of configuring the Option82 function using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Item |
Data |
Description |
---|---|---|
Whether to enable the Option82 function on a DHCP relay agent |
true |
Enable the Option82 function on the DHCP relay agent. |
Whether to enable the function of adding the Option82 field to DHCP messages |
true |
Enable the function of adding the Option82 field to DHCP messages. |
Whether to enable the function of adding sub-option 9 to the Option82 field |
true |
Enable the function of adding sub-option 9 to the Option82 field. |
Format of sub-option 9 in the Option82 field | ip-address |
Set the format of sub-option 9 in the Option82 field to the IP address format. |
<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> <relay-information> <enable>true</enable> </relay-information> </dhcp-relay> </dhcp-relays> </dhcp-relay-configuration> <hw-dhcp:dhcp-option82-configuration> <hw-dhcp:option82-enable> <hw-dhcp:bd> <hw-dhcp:bd-id>26</hw-dhcp:bd-id> <hw-dhcp:insert-enable>true</hw-dhcp:insert-enable> </hw-dhcp:bd> </hw-dhcp:option82-enable> <hw-dhcp:option82-format> <hw-dhcp:vendor-specific-format> <hw-dhcp:global> <hw-dhcp:vsys>pub</hw-dhcp:vsys> <hw-dhcp:vendor-sub-option> <hw-dhcp:sub-option-code>23</hw-dhcp:sub-option-code> <hw-dhcp:ip-address>10.1.1.1</hw-dhcp:ip-address> </hw-dhcp:vendor-sub-option> </hw-dhcp:global> </hw-dhcp:vendor-specific-format> </hw-dhcp:option82-format> <hw-dhcp:sub-option-enable> <hw-dhcp:bd xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="merge"> <hw-dhcp:bd-id>26</hw-dhcp:bd-id> <hw-dhcp:vendor-specific-enable>true</hw-dhcp:vendor-specific-enable> </hw-dhcp:bd> </hw-dhcp:sub-option-enable> </hw-dhcp:dhcp-option82-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="47"> <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='Vlanif4000']/relay-information/enable</error-path> <error-message>parse rpc config error.(Invalid value in "enable" element.).</error-message> </rpc-error> </rpc-reply>