This section provides a sample of configuring an interface to use the global address pool to provide the DHCP server function using the rpc method.
Operation |
XPATH |
|---|---|
rpc |
/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/enable |
Item |
Data |
Description |
|---|---|---|
Whether an interface is configured to use the global address pool to provide the DHCP server function |
true |
Configure the interface to use the global address pool to provide the DHCP server function. |
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<if:interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
<if:name>Vlanif9</if:name>
<if:type xmlns:x="urn:ietf:params:xml:ns:yang:iana-if-type">x:propVirtual</if:type>
<if:ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
<if:address ns0:operation="merge">
<if:ip>10.10.10.44</if:ip>
<if:netmask>255.255.255.0</if:netmask>
</if:address>
</if:ipv4>
</if:interface>
</if:interfaces>
<hw-dhcp:dhcp-config xmlns:hw-dhcp="urn:huawei:params:xml:ns:yang:huawei-dhcp" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="create">
<hw-dhcp:dhcpv4-config>
<hw-dhcp:enable>true</hw-dhcp:enable>
<hw-dhcp:dhcp-server-configuration>
<hw-dhcp:dhcp-servers>
<hw-dhcp:dhcp-server>
<hw-dhcp:interface-name>Vlanif9</hw-dhcp:interface-name>
<hw-dhcp:enable>true</hw-dhcp:enable>
<hw-dhcp:global-pool/>
</hw-dhcp:dhcp-server>
</hw-dhcp:dhcp-servers>
</hw-dhcp:dhcp-server-configuration>
</hw-dhcp:dhcpv4-config>
</hw-dhcp:dhcp-config>
</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>