This section provides a sample of configuring network configuration parameters to be assigned to DHCP clients using the rpc method.
Operation |
XPATH |
---|---|
rpc |
Item |
Data |
Description |
---|---|---|
Name of a global address pool |
pool1 |
Set the name of the global address pool to pool1. |
IP address of the SIP server |
10.1.20.33 | Set the IP address of the SIP server to 10.1.20.33. |
IP address of the DNS server |
10.3.3.3 | Set the IP address of the DNS server to 10.3.3.3. |
Name of the server from which the DHCP client obtains the startup configuration file |
ftpserver | Set the name of the server from which the DHCP client obtains the startup configuration file to ftpserver. |
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> <address-management xmlns="urn:huawei:params:xml:ns:yang:huawei-address-management" xc:operation="merge"> <ipv4> <ip-pools> <ip-pool> <name>pool1</name> <vsys>pub</vsys> <sip-server> <ip-address>10.1.20.33</ip-address> </sip-server> <dns-server> <ip-address>10.3.3.3</ip-address> </dns-server> <sname>ftpserver</sname> </ip-pool> </ip-pools> </ipv4> </address-management> </config> </edit-config> </rpc>
Sample of successful response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
Sample of failed response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>Wrong parameter.</error-message> <error-info>Error on node /huawei-address-management:address-management/ipv4/ip-pools/ip-pool[vsys="pub",name="pool1"]/sname</error-info> </rpc-error> </rpc-reply>