No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

NETCONF YANG API Reference

AR100, AR120, AR160, AR1200, AR2200, AR3200, and AR3600 V300R003

NETCONF YANG API Reference
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
DHCP

DHCP

DHCP Server

This section describes the data model of the DHCP server based on the interface address pool, and samples of configured XML packets.

Data Model

The data model file matching the DHCP server is huawei-dhcp.yang.

Table 3-250 DHCP server

Object

Description

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-enable/enable/enable

Indicates that the DHCP function is enabled.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/enable

Indicates that the DHCP server function is enabled.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/lease

Indicates that the IP address lease is configured in the interface address pool.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/excluded-address/ip-subnet

Indicates that the IP addresses not to be automatically allocated are configured in the interface address pool.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/static-binding/address-binding

Indicates that the fixed IP addresses are allocated to clients in the interface address pool.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/domain-suffix

Indicates that the DNS domain name suffixes are allocated to clients in the interface address pool.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/dns/dns-server

Indicates that the IP address of the DNS server is specified for clients in the interface address pool.

/huawei-dhcp:dhcp-state/dhcpv4-state/dhcp-server-state

Checks IP address allocation and statistics information in an IP address pool.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/nbns-server/ip-address

Indicates that the IP address of the NetBIOS server is specified for clients in the interface address pool.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/netbios-type

Indicates that the NetBIOS node type for a DHCP client in the interface address pool. The value include:

  • b-node: Indicates a node in broadcast mode. A b-node obtains the mapping in broadcast mode.
  • h-node: Indicates a node in hybrid mode. An h-node is a b-type node enabled with the end-to-end communication mechanism.
  • m-node: Indicates a node in mixed mode. An m-node is a p-type node with some broadcast features.
  • p-node: Indicates a node in peer-to-peer mode. This node obtains mappings by communicating with the NetBIOS server.
Interface Address Pool
Configuring an Interface Address Pool

This section provides packet samples for configuring an interface address pool using the merge method. In addition, the create method can be adopted for configuring an interface address pool.

Table 3-251 Configuring an interface address pool

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server

Data Requirements
Table 3-252 Configuring an interface address pool

Item

Data

Description

Whether the DHCP function is enabled

true

Configure VLANIF 23 as the interface address pool, and set the network segment and mask of the address pool to 10.19.13.0 and 24.

VLANIF interface number

23

VLANIF interface IP address

10.19.13.11/24

Whether the DHCP server function is enabled

true

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp"> 
    <dhcpv4-config xc:operation="merge"> 
     <enable>true</enable> 
     <dhcp-server-configuration> 
      <dhcp-servers> 
       <dhcp-server> 
        <interface-name>Vlanif23</interface-name> 
        <enable>true</enable> 
        <interface-pool/> 
       </dhcp-server> 
      </dhcp-servers> 
     </dhcp-server-configuration> 
    </dhcpv4-config> 
 </dhcp-config> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface xc:operation="merge"> 
     <name>Vlanif23</name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type> 
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"> 
      <address> 
       <ip>10.19.13.11</ip> 
       <prefix-length>24</prefix-length> 
      </address> 
     </ipv4> 
    </interface> 
 </interfaces> 
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan"> 
    <vlan xc:operation="merge"> 
     <id>23</id> 
    </vlan> 
 </vlans> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Changing the Network Segment of an Interface Address Pool

This section provides packet samples for changing an interface address pool using the replace method.

Table 3-253 Changing the network segment of an interface address pool

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server

Data Requirements
Table 3-254 Changing the network segment of an interface address pool

Item

Data

Description

Whether the DHCP function is enabled

true

Modify the network segment and mask of interface address pool VLANIF 23 to 192.168.13.0 and 24.

VLANIF interface number

23

VLANIF interface IP address

192.168.13.11/24

Whether the DHCP server function is enabled

true

Request Example

Delete DHCP configurations on VLANIF 23.

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp"> 
    <dhcpv4-config xc:operation="merge"> 
     <enable>true</enable> 
     <dhcp-server-configuration> 
      <dhcp-servers> 
       <dhcp-server xc:operation="remove"> 
        <interface-name>Vlanif23</interface-name> 
        <enable>true</enable> 
        <interface-pool/> 
       </dhcp-server> 
      </dhcp-servers> 
     </dhcp-server-configuration> 
    </dhcpv4-config> 
 </dhcp-config> 
  </config> 
 </edit-config> 
</rpc>

Modify the IP address of VLANIF 23 and deliver the DHCP configurations.

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_e439452ff599403da6e5074a1410f6d6"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp"> 
    <dhcpv4-config xc:operation="merge"> 
     <enable>true</enable> 
     <dhcp-server-configuration> 
      <dhcp-servers> 
       <dhcp-server> 
        <interface-name>Vlanif23</interface-name> 
        <enable>true</enable> 
        <interface-pool/> 
       </dhcp-server> 
      </dhcp-servers> 
     </dhcp-server-configuration> 
    </dhcpv4-config> 
 </dhcp-config> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface xc:operation="replace"> 
     <name>Vlanif23</name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type> 
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"> 
      <address> 
       <ip>192.168.13.11</ip> 
       <prefix-length>24</prefix-length> 
      </address> 
     </ipv4> 
    </interface> 
 </interfaces> 
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan"> 
    <vlan xc:operation="merge"> 
     <id>23</id> 
    </vlan> 
 </vlans> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply>
Deleting an Interface Address Pool

This section provides packet samples for deleting an interface address pool using the remove method.

Table 3-255 Deleting an interface address pool

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server

Data Requirements
Table 3-256 Deleting an interface address pool

Item

Data

Description

Whether the DHCP function is enabled

true

Delete the interface address pool VLANIF 23.

VLANIF interface number

23

VLANIF interface IP address

10.19.13.11/24

Whether the DHCP server function is enabled

true

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp"> 
    <dhcpv4-config xc:operation="merge"> 
     <enable>true</enable> 
     <dhcp-server-configuration> 
      <dhcp-servers> 
       <dhcp-server> 
        <interface-name>Vlanif23</interface-name> 
        <enable>true</enable> 
        <interface-pool/> 
       </dhcp-server> 
      </dhcp-servers> 
     </dhcp-server-configuration> 
    </dhcpv4-config> 
 </dhcp-config> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface xc:operation="remove"> 
     <name>Vlanif23</name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type> 
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"> 
      <address> 
       <ip>10.19.13.11</ip> 
       <prefix-length>24</prefix-length> 
      </address> 
     </ipv4> 
    </interface> 
 </interfaces> 
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan"> 
    <vlan xc:operation="remove"> 
     <id>23</id> 
    </vlan> 
 </vlans> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
IP Address Lease
Configuring an IP Address Lease

This section provides packet samples for configuring an IP address lease using the merge method. In addition, the create method can be adopted for configuring an IP address lease.

Table 3-257 Configuring an IP address lease

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-258 Configuring an IP address lease

Item

Data

Description

Whether the DHCP function is enabled

true

Configure the IP address lease of the interface address pool VLANIF 23 as 2 days 5 hours and 30 minutes.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP address lease

2 days 5 hours and 30 minutes

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration>
    <dhcp-servers>
     <dhcp-server >
      <enable>true</enable>
      <interface-name>Vlanif23</interface-name>
       <interface-pool>
        <lease>
         <lease-time>
          <day>2</day>
          <hour>5</hour>
          <minute>30</minute>
         </lease-time>
        </lease>
       </interface-pool>
     </dhcp-server>
    </dhcp-servers>
   </dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Changing an IP Address Lease

This section provides packet samples for modifying an IP address lease using the replace method.

Table 3-259 Changing an IP address lease

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-260 Changing an IP address lease

Item

Data

Description

Whether the DHCP function is enabled

true

Change the IP address lease of the interface address pool VLANIF 23 to 3 days 5 hours and 30 minutes.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP address lease

3 days 5 hours and 30 minutes

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="replace">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration>
    <dhcp-servers>
     <dhcp-server >
      <enable>true</enable>
      <interface-name>Vlanif23</interface-name>
       <interface-pool>
        <lease>
         <lease-time>
          <day>3</day>
          <hour>5</hour>
          <minute>30</minute>
         </lease-time>
        </lease>
       </interface-pool>
     </dhcp-server>
    </dhcp-servers>
   </dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Resetting an IP Address Lease

This section provides packet samples for restoring the IP address lease to the default value using the remove method.

Table 3-261 Resetting the IP address lease

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-262 Resetting the IP address lease

Item

Data

Description

Whether the DHCP function is enabled

true

Restore the IP address lease of the interface address pool VLANIF 23 to the default value (one day).

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP address lease

One day

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="remove">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration>
    <dhcp-servers>
     <dhcp-server >
      <enable>true</enable>
      <interface-name>Vlanif23</interface-name>
       <interface-pool>
        <lease>
         <lease-time>
          <day>1</day>
          <hour>0</hour>
          <minute>0</minute>
         </lease-time>
        </lease>
       </interface-pool>
     </dhcp-server>
    </dhcp-servers>
   </dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
IP Addresses Not to Be Automatically Allocated in the Address Pool
Configuring the IP Addresses Not to Be Automatically Allocated in the Address Pool

This section provides packet samples for configuring the IP addresses not to be automatically allocated in the address pool using the merge method. In addition, the create method can be adopted to configure the IP addresses not to be automatically allocated in the address pool.

Table 3-263 Configuring the IP addresses not to be automatically allocated in the address pool

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-264 Configuring the IP addresses not to be automatically allocated in the address pool

Item

Data

Description

Whether the DHCP function is enabled

true

Configure the IP addresses 10.19.13.10 to 10.19.13.13 in the interface address pool VLANIF 23 not to be automatically allocated.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP addresses not to be automatically allocated

10.19.13.10-10.19.13.13

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
     <interface-pool>
      <excluded-address>
      <ip-subnet>
       <start-ip-address>10.19.13.10</start-ip-address>
       <end-ip-address>10.19.13.13</end-ip-address>
      </ip-subnet>
      </excluded-address>
     </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc> 
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Modifying the IP Addresses Not to Be Automatically Allocated in the Address Pool

This section provides packet samples for modifying the IP addresses not to be automatically allocated in the address pool using the replace method.

Table 3-265 Modifying the IP addresses not to be automatically allocated in the address pool

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-266 Modifying the IP addresses not to be automatically allocated in the address pool

Item

Data

Description

Whether the DHCP function is enabled

true

Modify the IP addresses not to be automatically allocated in the interface address pool VLANIF 23 to 10.19.13.10 to 10.19.13.20.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP addresses not to be automatically allocated

10.19.13.10-10.19.13.20

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
     <interface-pool>
      <excluded-address xc:operation="replace">
      <ip-subnet>
       <start-ip-address>10.19.13.10</start-ip-address>
       <end-ip-address>10.19.13.20</end-ip-address>
      </ip-subnet>
      </excluded-address>
     </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc> 
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Deleting the IP Addresses Not to Be Automatically Allocated in the Address Pool

This section provides packet samples for deleting the IP addresses not to be automatically allocated in the address pool using the remove method.

Table 3-267 Deleting the IP addresses not to be automatically allocated in the address pool

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-268 Deleting the IP addresses not to be automatically allocated in the address pool

Item

Data

Description

Whether the DHCP function is enabled

true

Delete IP addresses not to be automatically allocated, so that all IP addresses in the interface address pool VLANIF 23 can be automatically allocated.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP addresses not to be automatically allocated

10.19.13.10-10.19.13.20

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
     <interface-pool>
      <excluded-address xc:operation="remove">
      <ip-subnet>
       <start-ip-address>10.19.13.10</start-ip-address>
       <end-ip-address>10.19.13.20</end-ip-address>
      </ip-subnet>
      </excluded-address>
     </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Allocating Fixed IP Addresses to the Clients
Configuring Fixed IP Addresses to Be Allocated to the Clients

This section provides packet samples for configuring fixed IP addresses to be allocated to the clients using the merge method. In addition, the create method can be adopted to configure fixed IP addresses to be allocated to the clients.

Table 3-269 Configuring fixed IP addresses to be allocated to the clients

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-270 Configuring fixed IP addresses to be allocated to the clients

Item

Data

Description

Whether the DHCP function is enabled

true

Allocate an IP address 10.19.13.6 in the interface address pool VLANIF 23 to the client with the MAC address 00:01: 02:03 04:05.

VLANIF interface

23

Whether the DHCP server function is enabled

true

Fixed IP address to be allocated to the clients

IP address: 10.19.13.6

MAC address: 00:01:02:03:04:05

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
     <static-binding><address-binding>
      <ip-address>10.19.13.6</ip-address>
      <mac-address>00:01:02:03:04:05</mac-address>
     </address-binding></static-binding>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc> 
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Modifying Fixed IP Addresses to Be Allocated to the Clients

This section provides packet samples for modifying fixed IP addresses to be allocated to the clients using the replace method.

Table 3-271 Modifying fixed IP addresses for the clients

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data requirement
Table 3-272 Modifying fixed addresses to be allocated to the clients

Item

Data

Description

Whether the DHCP function is enabled

true

Modify the IP address in the interface address pool VLANIF 23 to be allocated to the client with the MAC address 00:01: 02:03 04:05 to 10.19.13.5.

VLANIF interface

23

Whether the DHCP server function is enabled

true

Fixed IP address to be allocated to the clients

IP address: 10.19.13.5

MAC address 00:01:02:03:04:05

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="replace">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
     <static-binding><address-binding>
      <ip-address>10.19.13.5</ip-address>
      <mac-address>00:01:02:03:04:05</mac-address>
     </address-binding></static-binding>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc> 
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Deleting Fixed IP Addresses to Be Allocated to the clients

This section provides packet samples for deleting fixed IP addresses to be allocated to the clients using the remove method.

Table 3-273 Deleting fixed addresses to be allocated to the clients

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-274 Deleting fixed addresses to be allocated to the clients

Item

Data

Description

Whether the DHCP function is enabled

true

Delete the fixed IP address from the interface address pool VLANIF 23.

VLANIF interface

23

Whether the DHCP server function is enabled

true

Fixed IP address to be allocated to the clients

IP address: 10.19.13.5

MAC address: 00:01:02:03:04:05

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="remove">
  <dhcpv4-config>
   <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
     <static-binding><address-binding>
      <ip-address>10.19.13.5</ip-address>
      <mac-address>00:01:02:03:04:05</mac-address>
     </address-binding></static-binding>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Specifying the IP Address of the DNS Server for a Client
Configuring the DNS Server IP Address Specified for a Client

This section provides packet samples for configuring the DNS server IP address specified for a client using the merge method. In addition, the create method can be adopted to configure the DNS server IP address specified for a client.

Table 3-275 Configuring the DNS server IP address specified for a client

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-276 Configuring the DNS server IP address specified for a client

Item

Data

Description

Whether the DHCP function is enabled

true

Configure the DNS server IP address for a client to 10.2.3.4 in the interface address pool VLANIF 23.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP address of the DNS server

10.2.3.4

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
  <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
    <dns><dns-server><ip-address>10.2.3.4</ip-address></dns-server></dns>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Modifying the DNS Server IP Address Specified for a Client

This section provides packet samples for modifying the DNS server IP address specified for a client using the replace method.

Table 3-277 Modifying the DNS server IP address specified for a client

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-278 Modifying the DNS server IP address specified for a client

Item

Data

Description

Whether the DHCP function is enabled

true

Modify the DNS server IP address specified for a client to 10.2.3.5 in the interface address pool VLANIF 23.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP address of the DNS server

10.2.3.5

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="replace">
  <dhcpv4-config>
  <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
    <dns><dns-server><ip-address>10.2.3.5</ip-address></dns-server></dns>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Deleting the DNS Server IP Address Specified for a Client

This section provides packet samples for deleting the DNS server IP address specified for a client using the remove method.

Table 3-279 Deleting the DNS server IP address specified for a client

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool

Data Requirements
Table 3-280 Deleting the DNS server IP address specified for a client

Item

Data

Description

Whether the DHCP function is enabled

true

Delete the DNS server IP address specified for a client in the interface address pool VLANIF 23.

VLANIF interface

23

Whether the DHCP server function is enabled

true

IP address of the DNS server

10.2.3.4

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="remove">
  <dhcpv4-config>
  <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
    <dns><dns-server><ip-address>10.2.3.4</ip-address></dns-server></dns>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Configuring the NetBIOS Service on DHCP Clients

This section provides packet samples for configuring the NetBIOS service on DHCP clients using the merge method.

Table 3-281 Configuring the NetBIOS Service on DHCP Clients

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/nbns-server/ip-address

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-server-configuration/dhcp-servers/dhcp-server/pool-type/interface-pool/interface-pool/netbios-type

Data Requirements
Table 3-282 Configuring the NetBIOS Service on DHCP Clients

Item

Data

Description

Whether the DHCP function is enabled

true

Enable DHCP.

VLANIF interface

23

VLANIF23.

Whether the DHCP server function is enabled

true

Enable the DHCP server function.

IP address of the NetBIOS server

10.1.1.1

NetBIOS server IP address is 10.1.1.1.

The NetBIOS node type for DHCP clients

p-node

The NetBIOS node type for DHCP clients is p-node.

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<edit-config>
<target>
<running/>
</target><error-option>rollback-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif23</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>10.19.13.11</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>23</id>
   </vlan>
 </vlans>
 <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp" xc:operation="merge">
  <dhcpv4-config>
  <enable>true</enable>
   <dhcp-server-configuration><dhcp-servers><dhcp-server >
    <enable>true</enable>
    <interface-name>Vlanif23</interface-name>
    <interface-pool>
     <nbns-server>
      <ip-address>10.1.1.1</ip-address>
     </nbns-server>
     <netbios-type>p-node</netbios-type>
    </interface-pool>
   </dhcp-server></dhcp-servers></dhcp-server-configuration>
  </dhcpv4-config>
 </dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Checking IP Address Allocation and Statistics Information in an IP Address Pool

This section provides a sample of checking IP address allocation and statistics information in an IP address pool using the get method.

Table 3-283 Checking IP address allocation and statistics information in an IP address pool

Operation

XPATH

edit-config:get

/huawei-dhcp:dhcp-state/dhcpv4-state/dhcp-server-state

Data Requirements

None

Request Example
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
 <filter type="subtree">
   <dhcp-state xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
    <dhcpv4-state>
     <dhcp-server-state>
     </dhcp-server-state>
   </dhcpv4-state>
  </dhcp-state> 
 </filter> 
</get>
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
<data>
 <dhcp-state xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
  <dhcpv4-state>
   <dhcp-server-state>
    <dynamic-bindings>
     <dynamic-binding>
      <interface-name>Vlanif5</interface-name>
       <address-binding>
        <ip-address>11.13.99.12</ip-address>
        <mac-address>20:20:20:20:20:20</mac-address>
       </address-binding>
      </dynamic-binding>
      <dynamic-binding>
       <interface-name>GigabitEthernet0/0/1</interface-name>
        <address-binding>
         <ip-address>11.14.99.70</ip-address>
         <mac-address>d4:00:0c:d0:f9:58</mac-address>
         <expire-time>82883</expire-time>
        </address-binding>
        <address-binding>
         <ip-address>11.14.99.12</ip-address>
         <mac-address>20:20:20:20:20:20</mac-address>
        </address-binding>
       </dynamic-binding>
      </dynamic-bindings>
      <interface-pool-statistics>
       <interface-pool-statistic>
        <interface-name>Vlanif5</interface-name>
         <section-statistic>
          <start-ip-address>11.13.99.1</start-ip-address>
          <end-ip-address>11.13.99.254</end-ip-address>
          <used-count>1</used-count>
          <free-count>253</free-count>
          <conflicting-count>0</conflicting-count>
          <excluded-count>0</excluded-count>
         </section-statistic>
        </interface-pool-statistic>
        <interface-pool-statistic>
         <interface-name>GigabitEthernet0/0/1</interface-name>
          <section-statistic>
           <start-ip-address>11.14.99.1</start-ip-address>
           <end-ip-address>11.14.99.254</end-ip-address>
           <used-count>2</used-count>
           <free-count>252</free-count>
           <conflicting-count>0</conflicting-count>
           <excluded-count>0</excluded-count>
          </section-statistic>
         </interface-pool-statistic>
        </interface-pool-statistics>
   </dhcp-server-state>
  </dhcpv4-state>
 </dhcp-state>
</data>
</rpc-reply>
Table 3-284 Descriptions of objects in the response example

Object

Description

/huawei-dhcp:dhcp-state/dhcpv4-state/dhcp-server-state/dynamic-bindings/dynamic-binding/interface-name/address-binding

Indicates allocated IP addresses in an interface address pool and their remaining lease time. The object includes:

  • ip-address: IP address allocated to a client
  • mac-address: MAC address of a client
  • expire-time: remaining lease time of the IP address
NOTE:

For a statically bound IP address, the expire-time field is not displayed.

/huawei-dhcp:dhcp-state/dhcpv4-state/dhcp-server-state/interface-pool-statistics/interface-pool-statistic/interface-name/section-statistic

Indicates statistics about IP addresses in an interface address pool. The object includes:

  • start-ip-address: start IP address of the address pool
  • end-ip-address: end IP address of the address pool
  • used-count: number of allocated IP addresses
  • free-count: number of available IP addresses
  • conflicting-count: number of conflicted IP addresses
  • excluded-count: number of excluded IP addresses

DHCP Relay

This section describes the configuration model of the DHCP relay and provides examples of XML packets.

Data Model

The data model file matching the DHCP relay is huawei-dhcp.yang.

Table 3-285 DHCP relay

Object

Description

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-enable/enable/enable

Indicates that the DHCP function is enabled.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays/dhcp-relay/enable

Indicates that the DHCP relay function is enabled.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays/dhcp-relay/server-ip

Indicates the IP address of the DHCP server.

Enabling the DHCP Relay Function

This section provides packet samples for enabling the DHCP relay function using the merge method. In addition, the create method can be adopted to enable the DHCP relay function.

Table 3-286 Enabling the DHCP relay function

Operation

XPATH

edit-Indicates the IP addresses that are not allocated automatically.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays

Data Requirements
Table 3-287 Enabling the DHCP relay function

Item

Data

Description

Whether the DHCP function is enabled

true

Enable the DHCP relay function on VLANIF 3, and set the IP address of the DHCP server to 10.1.1.2.

Whether the DHCP relay function is enabled

true

VLANIF interface

3

IP address of the DHCP server

10.1.1.2

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
 <edit-config>
 <target>
  <running/>
 </target>
 <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
  <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif3</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>192.168.10.1</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>3</id>
   </vlan>
 </vlans>
   <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
    <dhcpv4-config>
     <enable>true</enable>
     <dhcp-relay-configuration>
      <dhcp-relays>
       <dhcp-relay xc:operation="merge">
        <interface-name>Vlanif3</interface-name>
        <enable>true</enable>
         <server-ip>10.1.1.2</server-ip>
        </dhcp-relay>
      </dhcp-relays>
     </dhcp-relay-configuration>
    </dhcpv4-config>
   </dhcp-config>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Modifying the IP Address of the DHCP Server

This section provides packet samples for modifying the DHCP server IP address on the interface with the DHCP relay function enabled using the replace method.

Table 3-288 Modifying the DHCP server IP address on the interface with the DHCP relay function enabled

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays

Data Requirements
Table 3-289 Modifying the DHCP server IP address on the interface with the DHCP relay function enabled

Item

Data

Description

Whether the DHCP function is enabled

true

Modify the IP address of the DHCP server on VLANIF 3 with the DHCP relay function enabled to 192.168.1.2.

Whether the DHCP relay function is enabled

true

VLANIF interface

3

IP address of the DHCP server

192.168.1.2

Request example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
 <edit-config>
 <target>
  <running/>
 </target>
 <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif3</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>192.168.10.1</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>3</id>
   </vlan>
 </vlans>
   <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
    <dhcpv4-config>
     <enable>true</enable>
     <dhcp-relay-configuration>
      <dhcp-relays>
       <dhcp-relay xc:operation="replace">
        <interface-name>Vlanif3</interface-name>
        <enable>true</enable>
        <server-ip>192.168.1.2</server-ip>
       </dhcp-relay>
      </dhcp-relays>
     </dhcp-relay-configuration>
    </dhcpv4-config>
   </dhcp-config>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Disabling the DHCP Relay Function

This section provides packet samples for disabling the DHCP relay function using the remove method.

Table 3-290 Disabling the DHCP relay function

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-relay-configuration/dhcp-relays

Data Requirements
Table 3-291 Disabling the DHCP relay function

Item

Data

Description

Whether the DHCP function is enabled

true

Disable the DHCP relay function on VLANIF 3.

Whether the DHCP relay function is enabled

true

VLANIF interface

3

IP address of the DHCP server

10.1.1.2

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
 <edit-config>
 <target>
  <running/>
 </target>
 <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
   <interface xc:operation="merge">
    <name>Vlanif3</name>
    <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:propVirtual</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
     <address>
      <ip>192.168.10.1</ip>
      <prefix-length>24</prefix-length>
     </address>
    </ipv4>
   </interface>
 </interfaces>
 <vlans xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan">
   <vlan xc:operation="merge">
    <id>3</id>
   </vlan>
 </vlans>
   <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
    <dhcpv4-config>
     <enable>true</enable>
     <dhcp-relay-configuration>
      <dhcp-relays>
       <dhcp-relay xc:operation="remove">
        <interface-name>Vlanif3</interface-name>
        <enable>true</enable>
        <server-ip>10.1.1.2</server-ip>
       </dhcp-relay>
      </dhcp-relays>
     </dhcp-relay-configuration>
    </dhcpv4-config>
   </dhcp-config>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 

DHCP Client

Data Model

The data model file matching DHCP client is huawei-dhcp.yang.

Table 3-292 DHCP client data model

Object

Description

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/global

Configures the Option 60 field of DHCP request packets globally.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/interface

Configures the Option 60 field of DHCP request packets on an interface.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/client-id/interface

Configures the DHCP client flag.

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/default-route-preference/interface

Configures the priority of routing entries delivered from the DHCP server to DHCP clients.

NOTE:

For details on how to enable the DHCP client function, seeObtaining an IP Address in DHCP Mode.

DHCP Client Attributes

Configuring DHCP Client Attributes

This section provides a sample of configuring DHCP client attributes using the merge method. You can also use the create method to configure DHCP client attributes.

Table 3-293 Configuring DHCP client attributes

Operation

XPATH

edit-config:merge

  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/global
  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/interface
  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/client-id/interface
Data Requirements
Table 3-294 Configuring DHCP client attributes

Item

Data

Description

Option 60 field of DHCP request packets configured globally

huawei

Set the Option 60 field of DHCP request packets configured globally to huawei, the Option 60 field of DHCP request packets configured on GE0/0/1 to huawei123, and the DHCP client flag configured on GE0/0/1 to 2020-e2f3-2a3b.

Option 60 field of DHCP request packets configured on GE0/0/1

huawei-123

DHCP client flag configured on GE0/0/1

2020-e2f3-2a3b

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <edit-config>
  <target>
   <running/>
  </target>
 <error-option>rollback-on-error</error-option>
 <config>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
<interface> 
<name>GigabitEthernet0/0/3</name> 
<type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type>
<enabled>true</enabled>
</interface>
</interfaces>
  <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
   <dhcpv4-config>
    <dhcp-client-configuration>
     <class-id>
      <global xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
      <vsys>public</vsys>
       <option-value>huawei</option-value>
      </global>
    <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <option-value>huawei123</option-value>
    </interface>
     </class-id> 
     <client-id>
     <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <option-value>2020-e2f3-2a3b</option-value>
     </interface>
   </client-id> 
    </dhcp-client-configuration> 
   </dhcpv4-config>
  </dhcp-config>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 

Modifying DHCP Client Attributes

This section provides a sample of modifying DHCP client attributes using the replace method.

Table 3-295 Modifying DHCP client attributes

Operation

XPATH

edit-config:replace

  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/global
  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/interface
  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/client-id/interface
Data Requirements
Table 3-296 Modifying DHCP client attributes

Item

Data

Description

Option 60 field of DHCP request packets configured globally

huawei

The Option 60 field of DHCP request packets configured globally is huawei. Change the Option 60 field of DHCP request packets and DHCP client flag on GE0/0/1 to huawei456 and 845b-1236-5380, respectively.

Option 60 field of DHCP request packets configured on GE0/0/1

huawei-456

DHCP client flag configured on GE0/0/1

845b-1236-5380

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <edit-config>
  <target>
   <running/>
  </target>
 <error-option>rollback-on-error</error-option>
 <config>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
<interface> 
<name>GigabitEthernet0/0/1</name> 
<type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type>
<enabled>true</enabled>
</interface>
</interfaces>
  <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
   <dhcpv4-config>
    <dhcp-client-configuration>
     <class-id>
      <global xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
      <vsys>public</vsys>
       <option-value>huawei</option-value>
      </global>
    <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="replace">
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <option-value>huawei456</option-value>
    </interface>
     </class-id> 
     <client-id>
     <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="replace">
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <option-value>845b-1236-5380</option-value>
     </interface>
   </client-id> 
    </dhcp-client-configuration> 
   </dhcpv4-config>
  </dhcp-config>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Deleting DHCP Client Attributes

This section provides a sample of restoring default DHCP client attributes using the remove method.

Table 3-297 Deleting DHCP client attributes

Operation

XPATH

edit-config:remove

  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/global
  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/class-id/interface
  • /huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/client-id/interface
Data Requirements
Table 3-298 Deleting DHCP client attributes

Item

Data

Description

Option 60 field of DHCP request packets configured globally

huawei

Restore the Option 60 field of DHCP request packets in the system to huawei-device name, configure the Option 60 field of DHCP request packets configured on GE0/0/1 to be the same as that in the system, and restore the DHCP client flag to the MAC address of the client.

Option 60 field of DHCP request packets configured on GE0/0/1

huawei-123

DHCP client flag configured on GE0/0/1

2020-e2f3-2a3b

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <edit-config>
  <target>
   <running/>
  </target>
 <error-option>rollback-on-error</error-option>
 <config>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
<interface> 
<name>GigabitEthernet0/0/1</name> 
<type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type>
<enabled>true</enabled>
</interface>
</interfaces>
  <dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
   <dhcpv4-config>
    <dhcp-client-configuration>
     <class-id>
      <global xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="remove">
      <vsys>public</vsys>
       <option-value>huawei</option-value>
      </global>
    <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="remove">
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <option-value>huawei123</option-value>
    </interface>
     </class-id> 
     <client-id>
     <interface xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="remove">
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <option-value>2020-e2f3-2a3b</option-value>
     </interface>
   </client-id> 
    </dhcp-client-configuration> 
   </dhcpv4-config>
  </dhcp-config>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/>
</rpc-reply> 
Configuring the Priority of Routing Entries Delivered from the DHCP Server to DHCP Clients

Configuring the Priority of Routing Entries Delivered from the DHCP Server to DHCP Clients

This section provides a sample of configuring the priority of routing entries delivered from the DHCP server to DHCP clients using the merge method. You can also use the create method to configure the priority of routing entries delivered from the DHCP server to DHCP clients.

Table 3-299 Configuring the priority of routing entries delivered from the DHCP server to DHCP clients

Operation

XPATH

edit-config:merge

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/default-route-preference/interface

Data Requirements
Table 3-300 Configuring the priority of routing entries delivered from the DHCP server to DHCP clients

Item

Data

Description

Priority of routing entries delivered from the DHCP server to DHCP clients configured on GE0/0/1

100

Set the priority of routing entries delivered from the DHCP server to DHCP clients configured on GE0/0/1 to 100.

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
<edit-config>
<target>
<running/>
</target>
<error-option>rollback-on-error</error-option>
<config>
<dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
  <dhcpv4-config>
   <dhcp-client-configuration>
    <default-route-preference xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
    <interface>
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <preference>100</preference>
    </interface>
   </default-route-preference>
  </dhcp-client-configuration>   
 </dhcpv4-config>
</dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
 <ok/> 
</rpc-reply> 
Modifying the Priority of Routing Entries Delivered from the DHCP Server to DHCP Clients

This section provides a sample of modifying the priority of routing entries delivered from the DHCP server to DHCP clients using the replace method.

Table 3-301 Modifying the priority of routing entries delivered from the DHCP server to DHCP clients

Operation

XPATH

edit-config:replace

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/default-route-preference/interface

Data Requirements
Table 3-302 Modifying the priority of routing entries delivered from the DHCP server to DHCP clients

Item

Data

Description

Priority of routing entries delivered from the DHCP server to DHCP clients configured on GE0/0/1

80

Change the priority of routing entries delivered from the DHCP server to DHCP clients configured on GE0/0/1 to 80.

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
<edit-config>
<target>
<running/>
</target>
<error-option>rollback-on-error</error-option>
<config>
<dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
  <dhcpv4-config>
   <dhcp-client-configuration>
    <default-route-preference xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
    <interface>
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <preference>100</preference>
    </interface>
   </default-route-preference>
  </dhcp-client-configuration>   
 </dhcpv4-config>
</dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> 
<ok/> 
</rpc-reply> 
Deleting the Priority of Routing Entries Delivered from the DHCP Server to DHCP Clients

This section provides a sample of restoring the default priority of routing entries delivered from the DHCP server to DHCP clients using the remove method.

Table 3-303 Deleting the priority of routing entries delivered from the DHCP server to DHCP clients

Operation

XPATH

edit-config:remove

/huawei-dhcp:dhcp-config/dhcpv4-config/dhcp-client-configuration/default-route-preference/interface

Data Requirements
Table 3-304 Deleting the priority of routing entries delivered from the DHCP server to DHCP clients

Item

Data

Description

Priority of routing entries delivered from the DHCP server to DHCP clients configured on GE0/0/1

60

Restore the priority of routing entries delivered from the DHCP server to DHCP clients configured on GE0/0/1 to the default value 60.

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
<edit-config>
<target>
<running/>
</target>
<error-option>rollback-on-error</error-option>
<config>
<dhcp-config xmlns="urn:huawei:params:xml:ns:yang:huawei-dhcp">
  <dhcpv4-config>
   <dhcp-client-configuration>
    <default-route-preference xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="remove">
    <interface>
     <interface-name>GigabitEthernet0/0/1</interface-name>
     <preference>100</preference>
    </interface>
   </default-route-preference>
  </dhcp-client-configuration>   
 </dhcpv4-config>
</dhcp-config>
</config>
</edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> <ok/> </rpc-reply> 
Querying the Gateway Address of the DHCP Client Interface

This section provides a sample of querying the gateway address of the DHCP client interface.

NOTE:

This sample applies to V300R003C10 and later versions.

Data Model

The data model for querying the gateway address of the DHCP client interface is huawei-ip.yang. The data model is defined by IETF.

Table 3-305 Querying the gateway address of the DHCP client interface

Object

Description

/ietf-interfaces:interfaces-state/interface/ietf-ip:ipv4/huawei-ip:gateways/gateway

Displays the gateway address of the DHCP client interface.

Querying the Gateway Address of the DHCP Client Interface

This section provides a sample of querying the gateway address of the DHCP client interface using the get method.

Table 3-306 Querying the gateway address of the DHCP client interface

Operation

XPATH

get

/ietf-interfaces:interfaces-state/interface/ietf-ip:ipv4/huawei-ip:gateways/gateway

Data Requirements
Table 3-307 Querying the gateway address of the DHCP client interface

Item

Data

Description

Interface name

Ethernet0/0/4

Query the gateway address of Ethernet 0/0/4.

NOTE:
  • The gateway address of the DHCP client interface can be delivered by the DHCP server or obtained through the next-hop address of the static route. If the interface does not obtain the gateway address, 0.0.0.0 is returned.
  • When the DHCP server configures multiple gateway addresses for a DHCP client, the first gateway address obtained by the DHCP client is displayed.
  • If the route to the first gateway address obtained by the DHCP client is unreachable because the link is down or due to other reasons, you are advised to configure a reachable gateway address for the DHCP client on the DHCP server.
Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="#message-id"> 
 <get> 
  <filter type="subtree"> 
   <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface> 
     <name>Ethernet0/0/4</name> 
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"> 
      <gateways xmlns="urn:huawei:params:xml:ns:yang:hw-ip"> 
      </gateways> 
     </ipv4> 
    </interface> 
   </interfaces-state> 
  </filter> 
 </get> 
</rpc>
Response Example

Example of successful configuration response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="#message-id"> 
 <data> 
  <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
   <interface> 
    <name>Ethernet0/0/4</name> 
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"> 
     <gateways xmlns="urn:huawei:params:xml:ns:yang:hw-ip"> 
      <gateway>168.186.1.254</gateway> 
     </gateways> 
    </ipv4> 
   </interface> 
  </interfaces-state> 
 </data> 
</rpc-reply>
Table 3-308 Description of output information in the response example

Item

Description

name

Interface name.

gateway

Gateway address of the interface.

Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8524

Downloads: 69

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next