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).
DNS

DNS

Data Model

The data model file matching the DNS service is huawei-dns.yang.

Table 3-309 DNS

Object

Description

/huawei-dns:dns/dns-common/dns-resolve-enable

Enables the dynamic domain name resolution function.

/huawei-dns:dns/dns-common/dns-resolve-policy

Indicates that the object of requesting an operation (creation, deletion, and modification) is the DNS resolution policy. It is a root object, which is only used to contain sub-objects.

/huawei-dns:dns/dns-common/dns-resolve-policy/policy-a-enable

Indicates that the DNS resolution policy function is enabled and the DNS resolution policy view is displayed.

/huawei-dns:dns/dns-common/dns-resolve-policy/rules/rule

Indicates that a DNS resolution rule is configured.

/huawei-dns:dns/dns-proxy

Indicates that the object of requesting an operation (creation, deletion, and modification) is the DNS proxy. It is a root object, which is only used to contain sub-objects.

/huawei-dns:dns/dns-proxy/dns-proxy-enable

Indicates that the IPv4 DNS proxy function is enabled.

/huawei-dns:dns/dns-proxy/dns-proxy-ipv6-enable

Indicates that the IPv6 DNS proxy function is enabled.

/huawei-dns:dns/dns-relay

Indicates that the object of requesting an operation (creation, deletion, and modification) is the DNS relay agent. It is a root object, which is only used to contain sub-objects.

/huawei-dns:dns/dns-relay/dns-relay-ipv6-enable

Indicates that the IPv6 DNS relay function is enabled.

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv6/ipv6/ip-address

Indicates the DNS server accessed by the IPv6 DNS proxy or relay.

/huawei-dns:dns/dns-common/static-dns-entries/ip-address

Indicates a static IPv6 domain name entry.

Static DNS Entry

Configuring a Static DNS Entry

This section provides packet examples for configuring a static DNS entry using the merge method. You can also configure a static DNS entry using the create method.

Table 3-310 Configuring a static DNS entry

Operation

XPATH

edit-config:merge

/huawei-dns:dns/dns-common/static-dns-entries

Data Requirements
Table 3-311 Configuring a static DNS entry

Item

Data

Description

Static DNS entry

Domain name: huawei

IPv4 address: 10.1.1.1

IPv6 address: 1::28

Configure a static DNS entry with the domain name huawei, IPv4 address 10.1.1.1, and IPv6 address 1::28.

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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common> 
 <static-dns-entries xc:operation="merge">
  <host-name>huawei</host-name>
  <ip-address>10.1.1.1</ip-address>
  <ip-address>1::28</ip-address>
 </static-dns-entries>
 </dns-common> 
</dns>
</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 a Static DNS Entry

This section provides packet examples for modifying a static DNS entry using the replace method.

Table 3-312 Modifying a static DNS entry

Operation

XPATH

edit-config:replace

/huawei-dns:dns/dns-common/static-dns-entries

Data Requirements
Table 3-313 Modifying a static DNS entry

Item

Data

Description

Static DNS entry

Domain name: huawei

IPv4 address: 10.1.1.8

IPv6 address: 1::20

Modify the IPv4 and IPv6 addresses of a static DNS entry with the domain name huawei to 10.1.1.8 and 1::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"> 
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns"> 
 <dns-common>  
 <static-dns-entries xc:operation="replace"> 
  <host-name>huawei</host-name> 
  <ip-address>10.1.1.8</ip-address> 
  <ip-address>1::20</ip-address> 
 </static-dns-entries> 
 </dns-common>  
</dns> 
</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 a Static DNS Entry

This section provides packet examples for deleting a static DNS entry using the remove method.

Table 3-314 Deleting a static DNS entry

Operation

XPATH

edit-config:remove

/huawei-dns:dns/dns-common/static-dns-entries

Data Requirements
Table 3-315 Deleting a static DNS entry

Item

Data

Description

Static DNS entry

Domain name: huawei

IPv4 address: 10.1.1.8

IPv6 address: 1::20

Delete a static DNS entry with the domain name huawei, IPv4 address 10.1.1.8, and IPv6 address 1::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"> 
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns"> 
 <dns-common>  
 <static-dns-entries xc:operation="remove"> 
  <host-name>huawei</host-name> 
  <ip-address>10.1.1.8</ip-address> 
  <ip-address>1::20</ip-address> 
 </static-dns-entries> 
 </dns-common>  
</dns> 
</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> 

Dynamic Domain Name Resolution Function

Enabling the Dynamic Domain Name Resolution Function

This section provides a sample of enabling the dynamic domain name resolution function using the merge method. You can also use the create method to enable the dynamic domain name resolution function.

Table 3-316 Enabling the dynamic domain name resolution function

Operation

XPATH

edit-config:merge

/huawei-dns:dns/dns-common/dns-resolve-enable

Data Requirements
Table 3-317 Enabling the dynamic domain name resolution function

Item

Data

Description

Whether the dynamic domain name resolution function is enabled

true

Enable the dynamic domain name resolution function.

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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common>
  <dns-resolve-enable xc:operation="merge">true</dns-resolve-enable>
 </dns-common> 
</dns>
</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 a DNS Server

This section provides a sample of configuring the DNS server providing the dynamic domain name resolution function using the merge method. You can also use the create method to configure the DNS server providing the dynamic domain name resolution function.

Table 3-318 Configuring the DNS server providing the dynamic domain name resolution function

Operation

XPATH

edit-config:merge

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv6/ipv6/ip-address

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv4/ipv4/ip-address

Data Requirements
Table 3-319 Configuring the DNS server providing the dynamic domain name resolution function

Item

Data

Description

IPv4 DNS server

Server name: bc

IPv4 address: 192.168.1.1

Set the name and address of the IPv4 DNS server providing the dynamic domain name resolution function to bc and 192.168.1.1 respectively, and the name and address of the IPv6 DNS server providing the function to abc and 3::4 respectively.

IPv6 DNS server

Server name: abc

IPv6 address: 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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common>
 <dns-server xc:operation="merge">
  <name>abc</name>
  <ipv6>
  <ip-address>3::4</ip-address>
  </ipv6>
 </dns-server>
 <dns-server xc:operation="merge">
  <name>bc</name>
  <ipv4>
  <ip-address>192.168.1.1</ip-address>
  </ipv4>
 </dns-server>
 </dns-common>
</dns>
</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

This section provides a sample of modifying the DNS server providing the dynamic domain name resolution function using the replace method.

Table 3-320 Modifying the DNS server providing the dynamic domain name resolution function

Operation

XPATH

edit-config:replace

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv6/ipv6/ip-address

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv4/ipv4/ip-address

Data Requirements
Table 3-321 Modifying the DNS server providing the dynamic domain name resolution function

Item

Data

Description

IPv4 DNS server

Server name: bc

IPv4 address: 10.1.1.1

Change the address of the IPv4 DNS server providing the dynamic domain name resolution function to 10.1.1.1 and the address of the IPv6 DNS server providing the function to 1::4.

IPv6 DNS server

Server name: abc

IPv6 address: 1::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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common>
 <dns-server xc:operation="replace">
  <name>abc</name>
  <ipv6>
  <ip-address>1::4</ip-address>
  </ipv6>
 </dns-server>
 <dns-server xc:operation="replace">
  <name>bc</name>
  <ipv4>
  <ip-address>10.1.1.1</ip-address>
  </ipv4>
 </dns-server>
 </dns-common>
</dns>
</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

This section provides a sample of deleting the DNS server providing the dynamic domain name resolution function using the remove method.

Table 3-322 Deleting the DNS server providing the dynamic domain name resolution function

Operation

XPATH

edit-config:remove

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv6/ipv6/ip-address

/huawei-dns:dns/dns-common/dns-server/ip-version/ipv4/ipv4/ip-address

Data Requirements
Table 3-323 Deleting the DNS server providing the dynamic domain name resolution function

Item

Data

Description

IPv4 DNS server

Server name: bc

IPv4 address: 10.1.1.1

Delete the DNS server providing the dynamic domain name resolution function.

IPv6 DNS server

Server name: abc

IPv6 address: 1::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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common>
 <dns-server xc:operation="remove">
  <name>abc</name>
  <ipv6>
  <ip-address>1::4</ip-address>
  </ipv6>
 </dns-server>
 <dns-server xc:operation="remove">
  <name>bc</name>
  <ipv4>
  <ip-address>10.1.1.1</ip-address>
  </ipv4>
 </dns-server>
 </dns-common>
</dns>
</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 Dynamic Domain Name Resolution Function

This section provides a sample of disabling the dynamic domain name resolution function using the remove method.

Table 3-324 Disabling the dynamic domain name resolution function

Operation

XPATH

edit-config:remove

/huawei-dns:dns/dns-common/dns-resolve-enable

Data Requirements
Table 3-325 Disabling the dynamic domain name resolution function

Item

Data

Description

Whether the dynamic domain name resolution function is enabled

false

Disable the dynamic domain name resolution function.

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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common>
  <dns-resolve-enable xc:operation="remove">false</dns-resolve-enable>
 </dns-common> 
</dns>
</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> 

DNS Resolution Policy

NOTE:

Before configuring the DNS resolution policy, configure the dynamic domain name resolution function. For details, see Dynamic Domain Name Resolution Function.

Configuring a DNS Resolution Policy

This section provides packet examples for configuring DNS resolution policies using the merge method. In addition, the create method can also be adopted to configure DNS resolution policies.

Table 3-326 Configuring a DNS resolution policy

Operation

XPATH

edit-config:merge

/huawei-dns:dns/dns-common/dns-resolve-policy

Data Requirements
Table 3-327 Configuring a DNS resolution policy

Item

Data

Description

Whether DNS resolution policy is enabled

true

Add rule 5 to the DNS resolution policy to spoof a reply message with the IP address 10.6.6.6 to the DNS request for the domain name huawei.

DNS resolution rule

rule-id:5

match-name:huawei

spoof: 10.6.6.6

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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
 <dns-common>
 <dns-resolve-enable>true</dns-resolve-enable>
  <dns-resolve-policy>
   <policy-a-enable>true</policy-a-enable>
   <rules>
    <rule xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="merge">
     <rule-id>5</rule-id>
     <match-name>huawei</match-name>
     <spoof>10.6.6.6</spoof>
    </rule> 
   </rules>
 </dns-resolve-policy>
 </dns-common> 
</dns>
</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 a DNS Resolution Policy

This section provides packet examples for modifying DNS resolution policies using the replace method.

Table 3-328 Modifying a DNS resolution policy

Operation

XPATH

edit-config:replace

/huawei-dns:dns/dns-common/dns-resolve-policy

Data Requirements
Table 3-329 Modifying a DNS resolution policy

Item

Data

Description

Whether DNS resolution policy is enabled

true

Modify rule 5 in the DNS resolution policy to spoof a reply message with the IP address 10.6.6.6 to the DNS request for the domain name www.huawei.com.

DNS resolution rule

rule-id:5

match-name:www.huawei.com

spoof: 10.6.6.6

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"> 
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns"> 
    <dns-common> 
  <dns-resolve-enable xc:operation="replace">true</dns-resolve-enable> 
  <dns-resolve-policy xc:operation="replace"> 
 <policy-a-enable>true</policy-a-enable> 
 <rules> 
    <rule xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:operation="replace"> 
     <rule-id>5</rule-id> 
     <match-name>www.huawei.com</match-name> 
     <spoof>10.6.6.6</spoof> 
    </rule>  
 </rules> 
  </dns-resolve-policy> 
 </dns-common>  
</dns> 
</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 a DNS Resolution Policy

This section provides packet examples for deleting DNS resolution policies using the remove method.

Table 3-330 Deleting a DNS resolution policy

Operation

XPATH

edit-config:remove

/huawei-dns:dns/dns-common/dns-resolve-policy

Data Requirements
Table 3-331 Deleting a DNS resolution policy

Item

Data

Description

Whether DNS resolution policy is enabled

false

Delete the DNS resolution policy configuration.

DNS resolution rule

rule-id:5

match-name:www.huawei.com

spoof: 10.6.6.6

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">
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns">
    <dns-common>
  <dns-resolve-enable>true</dns-resolve-enable>
  <dns-resolve-policy xc:operation="remove">
   <policy-a-enable>false</policy-a-enable>
   <rules>
    <rule>
     <rule-id>5</rule-id>
     <match-name>www.huawei.com</match-name>
     <spoof>10.6.6.6</spoof>
    </rule> 
   </rules>
  </dns-resolve-policy>
 </dns-common> 
</dns>
</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> 

DNS Relay/Proxy Function

NOTE:

After enabling the DNS relay or proxy function, select one or more of the following methods to configure the domain name resolution function:

Enabling the DNS Relay/Proxy Function

This section provides packet examples for enabling IPv4 and IPv6 DNS relay/proxy function using the merge method. In addition, the create method can also be adopted to enable IPv4 and IPv6 DNS relay/proxy function.

Table 3-332 Enabling the DNS relay/proxy function

Operation

XPATH

edit-config:merge

/huawei-dns:dns/dns-proxy

/huawei-dns:dns/dns-relay

Data Requirements
Table 3-333 Enabling the DNS relay/proxy function

Item

Data

Description

Whether the IPv4 DNS relay function is enabled

true

Enable the IPv4 and IPv6 DNS relay/proxy function.

Whether the IPv4 DNS proxy function is enabled

true

Whether the IPv6 DNS relay function is enabled

true

Whether the IPv6 DNS proxy 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"> 
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns"> 
 <dns-relay> 
  <dns-relay-enable xc:operation="merge">true</dns-relay-enable> 
  <dns-relay-ipv6-enable xc:operation="merge">true</dns-relay-ipv6-enable> 
 </dns-relay> 
 <dns-proxy> 
  <dns-proxy-enable xc:operation="merge">true</dns-proxy-enable> 
  <dns-proxy-ipv6-enable xc:operation="merge">true</dns-proxy-ipv6-enable> 
 </dns-proxy> 
</dns> 
</config> 
</edit-config> 
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 DNS Relay/Proxy Function

This section provides packet examples for disabling IPv4 and IPv6 DNS relay/proxy function using the merge method.

Table 3-334 Disabling the DNS relay/proxy function

Operation

XPATH

edit-config:merge

/huawei-dns:dns/dns-proxy

/huawei-dns:dns/dns-relay

Data Requirements
Table 3-335 Disabling the DNS relay/proxy function

Item

Data

Description

Whether the IPv4 DNS relay function is enabled

false

Disable the IPv4 and IPv6 DNS relay/proxy function.

Whether the IPv4 DNS proxy function is enabled

false

Whether the IPv6 DNS relay function is enabled

false

Whether the IPv6 DNS proxy function is enabled

false

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"> 
<dns xmlns="urn:huawei:params:xml:ns:yang:huawei-dns"> 
 <dns-relay> 
  <dns-relay-enable xc:operation="merge">false</dns-relay-enable> 
  <dns-relay-ipv6-enable xc:operation="merge">false</dns-relay-ipv6-enable> 
 </dns-relay> 
 <dns-proxy> 
  <dns-proxy-enable xc:operation="merge">false</dns-proxy-enable> 
  <dns-proxy-ipv6-enable xc:operation="merge">false</dns-proxy-ipv6-enable> 
 </dns-proxy> 
</dns> 
</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> 
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8332

Downloads: 69

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