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).
Tunnel Interface

Tunnel Interface

A virtual tunnel interface (tunnel interface) is a Layer 3 logical interface. Devices at both ends use tunnel interfaces to transmit packets, and identify and process packets transmitted over a tunnel.

Data Model

The data model file matching the tunnel interface is huawei-tunnel.yang.

Table 3-31 Tunnel interface

Object

Description

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel

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

/ietf-interfaces:interfaces/interface/name

Indicates the tunnel interface name.

/ietf-interfaces:interfaces/interface/iana-if-type:type

Indicates that the interface type is a tunnel interface.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/tunnel-type

Indicates the tunneling protocol of the tunnel interface.

By default, the tunneling protocol of the tunnel interface is none, indicating that packets are not encapsulated.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/qos-preclassify

Indicates whether original packet information is pre-extracted.

By default, the system does not pre-extract original packet information.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/source-address

Indicates the source address of the tunnel.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/source-interface

Indicates the source interface of the tunnel.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/destination-address

Indicates the destination address of the tunnel.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/route-via/mode

Indicates the type of specified outbound interface of the tunnel.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/route-via/interface

Indicates the specified outbound interface of the tunnel.

Configuring a Tunnel Interface

This section provides a sample of creating and configuring a tunnel interface.

Table 3-32 Configuring a tunnel interface

Operation

XPATH

edit-config: default

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel

Data Requirements
Table 3-33 Configuring Tunnel0/0/1

Item

Data

Description

Tunnel interface name

Tunnel0/0/1

Create Tunnel0/0/1. The IP address of Tunnel0/0/1 is 10.1.1.1 and the mask is 24 bits. The encapsulation mode of Tunnel0/0/1 is GRE. The GRE tunnel's source address is 1.1.1.1, and the destination address is 2.2.2.2. Tunnel0/0/1 is configured to pre-extract original packet information.

IP address

10.1.1.1/24

Tunneling protocol of the Tunnel interface

gre

Source address of the tunnel

1.1.1.1

Destination address of the tunnel

2.2.2.2

Whether original packet information is pre-extracted

true

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_64b67f9d889d4871bfdb2af89a87540b">
 <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>
     <name>Tunnel0/0/1</name>
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:tunnel</type>
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
       <ip>10.1.1.1</ip>
       <netmask>255.255.255.0</netmask>
      </address>
     </ipv4>
     <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel">
      <tunnel-type>gre</tunnel-type>
      <source-address>1.1.1.1</source-address>
      <destination-address>2.2.2.2</destination-address>
      <qos-preclassify>true</qos-preclassify>
     </tunnel>
    </interface>
   </interfaces>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

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

Modifying the Tunnel Interface Configuration

This section provides a sample of modifying the tunnel interface configuration. On the same tunnel interface, the new configuration overwrites the old configuration. That is, the new configuration takes effect.

Table 3-34 Modifying the tunnel interface configuration

Operation

XPATH

edit-config: defult

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel

Data Requirements
Table 3-35 Modifying the tunnel interface configuration

Item

Data

Description

Tunnel Interface name

Tunnel0/0/1

Modify the configuration of Tunnel0/0/1. The IP address of Tunnel0/0/1 is 10.1.1.1 and the mask is 24 bits. The encapsulation mode of Tunnel0/0/1 is GRE. The GRE tunnel's source interface is GigabitEthernet1/0/0, and the destination address is 2.2.2.2. Disable Tunnel0/0/1 from pre-extracting original packet information.

IP address

10.1.1.1/24

Tunneling protocol of the Tunnel interface

gre

Source interface of the tunnel

GigabitEthernet1/0/0

Destination address of the tunnel

2.2.2.2

Whether original packet information is pre-extracted

false

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_64b67f9d889d4871bfdb2af89a87540b">
 <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>
        <name>GigabitEthernet1/0/0</name>
        <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type>
     </interface>
    <interface>
     <name>Tunnel0/0/1</name>
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:tunnel</type>
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
       <ip>10.1.1.1</ip>
       <netmask>255.255.255.0</netmask>
      </address>
     </ipv4>
     <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel">
      <tunnel-type>gre</tunnel-type>
      <source-interface>GigabitEthernet1/0/0</source-interface>
      <destination-address>2.2.2.2</destination-address>
      <qos-preclassify>false</qos-preclassify>
     </tunnel>
    </interface>
   </interfaces>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

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

Deleting the Tunnel Interface Configuration

This section provides a sample of deleting the tunnel interface configuration.

Table 3-36 Deleting the tunnel interface configuration

Operation

XPATH

edit-config:remove

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel

Data Requirements
Table 3-37 Deleting the configuration of Tunnel0/0/1

Item

Data

Description

Tunnel Interface name

Tunnel0/0/1

Delete the configuration of Tunnel0/0/1.

IP address

10.1.1.1/24

Tunneling protocol of the Tunnel interface

gre

Source interface of the tunnel

GigabitEthernet1/0/0

Destination address of the tunnel

2.2.2.2

Whether original packet information is pre-extracted

false

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_64b67f9d889d4871bfdb2af89a87540b">
 <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>
        <name>GigabitEthernet1/0/0</name>
        <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type>
     </interface>
    <interface>
     <name>Tunnel0/0/1</name>
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:tunnel</type>
     <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
       <ip>10.1.1.1</ip>
       <netmask>255.255.255.0</netmask>
      </address>
     </ipv4>
     <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel" xc:operation="remove">
      <tunnel-type>gre</tunnel-type>
      <source-interface>GigabitEthernet1/0/0</source-interface>
      <destination-address>2.2.2.2</destination-address>
      <qos-preclassify>false</qos-preclassify>
     </tunnel>
    </interface>
   </interfaces>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

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

Configuring Parameters for the Specified Physical Outbound Interface of an mGRE Tunnel

Configuring Parameters for the Specified Physical Outbound Interface of an mGRE Tunnel

This section describes how to configuring parameters for the specified physical outbound interface of an mGRE tunnel.

Table 3-38 Configuring parameters for the specified physical outbound interface of an mGRE tunnel

Operation

XPATH

edit-config:default

ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/route-via

Data Requirements
Table 3-39 Configuring parameters for the specified physical outbound interface of an mGRE tunnel

Item

Data

Description

Type and number of a physical outbound interface

GigabitEthernet0/0/3

Set GigabitEthernet0/0/3 as the physical outbound interface of the mGRE tunnel and specify that only the selected physical outbound interface can be used to forward traffic.

Route selection mode of the physical outbound interface

mandatory

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="NETCONFIG_1e52d2ce73564792aa527d3a615ecc31"> 
    <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>Tunnel0/0/20</name> 
      <type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:tunnel</type>      
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip" xc:operation="merge"> 
       <address> 
        <ip>50.1.1.2</ip> 
          <prefix-length>24</prefix-length> 
       </address> 
      </ipv4> 
      <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel" xc:operation="merge"> 
         <tunnel-type>mgre</tunnel-type> 
         <source-interface>GigabitEthernet0/0/3</source-interface> 
       <route-via> 
          <mode>mandatory</mode> 
          <interface>GigabitEthernet0/0/3</interface> 
       </route-via> 
       <nhrp xmlns="urn:huawei:params:xml:ns:yang:huawei-dsvpn"> 
        <nhrp-entry> 
           <protocol-address>10.1.1.1</protocol-address> 
           <register>true</register> 
           <nbma-address>46.1.1.2</nbma-address> 
        </nhrp-entry> 
          <nhrp-regiseter-interval>5</nhrp-regiseter-interval> 
          <shortcut-enable>true</shortcut-enable> 
          <unique-enable>false</unique-enable> 
       </nhrp> 
      </tunnel> 
     </interface> 
    </interfaces>
  </config>
 </edit-config>
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="NETCONFIG_1e52d2ce73564792aa527d3a615ecc31"> 
   <ok/>  
 </rpc-reply>
Deleting Parameters for the Specified Physical Outbound Interface of an mGRE Tunnel

This section describes how to delete parameters for the specified physical outbound interface of an mGRE tunnel.

Table 3-40 Deleting parameters for the specified physical outbound interface of an mGRE tunnel

Operation

XPATH

edit-config:remove

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/route-via

Data Requirements
Table 3-41

Item

Data

Description

Type and number of a physical outbound interface

GigabitEthernet0/0/3

Specify that GigabitEthernet0/0/3 is not the physical outbound interface of the mGRE tunnel and that traffic can be forwarded by other interfaces apart from the selected physical outbound interface.

Route selection mode of the physical outbound interface

mandatory

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="NETCONFIG_1e52d2ce73564792aa527d3a615ecc31"> 
  <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>Tunnel0/0/20</name> 
      <type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:tunnel</type>      
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip" xc:operation="merge"> 
       <address> 
        <ip>50.1.1.2</ip> 
          <prefix-length>24</prefix-length> 
       </address> 
      </ipv4> 
      <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel" xc:operation="remove"> 
         <tunnel-type>mgre</tunnel-type> 
         <source-interface>GigabitEthernet0/0/3</source-interface> 
       <route-via> 
          <mode>mandatory</mode> 
          <interface>GigabitEthernet0/0/3</interface> 
       </route-via> 
       <nhrp xmlns="urn:huawei:params:xml:ns:yang:huawei-dsvpn"> 
        <nhrp-entry> 
           <protocol-address>10.1.1.1</protocol-address> 
           <register>true</register> 
           <nbma-address>46.1.1.2</nbma-address> 
        </nhrp-entry> 
          <nhrp-regiseter-interval>5</nhrp-regiseter-interval> 
          <shortcut-enable>true</shortcut-enable> 
          <unique-enable>false</unique-enable> 
       </nhrp> 
      </tunnel> 
     </interface> 
    </interfaces>
  </config>
 </edit-config>
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="NETCONFIG_1e52d2ce73564792aa527d3a615ecc31"> 
   <ok/>  
 </rpc-reply>
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8537

Downloads: 69

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