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

GRE

The Generic Routing Encapsulation (GRE) protocol encapsulates packets of network layer protocols (such as IP and ATM) so that the packets can be transmitted over an IPv4 network.

This section describes the data model of tunnel interfaces and provides XML packet samples of creating, modifying, and deleting the tunnel interface configuration. Before configuring the GRE, configure a tunnel interface.

Data Model

The data model files matching the GRE definition are huawei-tunnel.yang and huawei-gre.yang.

Table 3-975 GRE

Object

Description

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

Indicates that the operation request (creating, deleting, and modifying) object is the Tunnel interface. It is a root object, which is only used to contain sub-objects, but does not have any data meaning.

/ietf-interfaces:interfaces/interface/name

Indicates the Tunnel interface name.

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

Indicates that the interface type is the Tunnel interface.

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

Indicates the tunnel protocol of the Tunnel interface.

By default, the tunnel encapsulation type is none, indicating that protocols are not encapsulated.

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

Indicates that the operation request (creating, deleting, and modifying) object is the GRE. It is a root object, which is only used to contain sub-objects, but does not have any data meaning.

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

Indicates the checksum of a GRE tunnel is enabled.

By default, the end-to-end checksum function is disabled on a Tunnel.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/huawei-gre:gre/plain-text

Indicates the keywords of a GRE tunnel is displayed in plain text. The value is an integer that ranges from 0 to 4294967295.

By default, the GRE keywords of a GRE tunnel are not configured.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/huawei-gre:gre/keep-alive

Indicates the Keepalive function of a GRE tunnel is enabled.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/huawei-gre:gre/keep-alive/period

Indicates the time interval for sending Keepalive packets. The value is an integer that ranges from 1 to 32767, in seconds. The default value is set to 5 seconds.

/ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/huawei-gre:gre/keep-alive/retry-times

Indicates the unreachability counter threshold. The value is an integer that ranges from 1 to 255. The default value is set to 3.

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-tunnel:tunnel/huawei-gre:gre/huawei-gre:key/huawei-gre:cipher-text

Indicates the identification keyword of a GRE tunnel. The value can be an integer that ranges from 0 to 4294967295 in plain text or a string of 32 or 48 characters in cipher text.

By default, no identification keyword is set for a GRE tunnel.

NOTE:

This object cannot be configured together with the /ietf-interfaces:interfaces/interface/huawei-tunnel:tunnel/huawei-gre:gre/plain-text object.

V300R003C10 and later versions support this node.

Configuring the GRE Security Mechanism

This section provides a sample of configuring the GRE security mechanism.

Table 3-976 Configuring the GRE security mechanism

Operation

XPATH

edit-config:default

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

Data Requirements
Table 3-977 Configuring the security mechanism on Tunnel0/0/1

Item

Data

Description

Tunnel interface name

Tunnel0/0/1

Create Tunnel0/0/1, set the IP address to 10.1.1.1, mask length to 24, and tunnel encryption mode to gre, and enable the checksum of the GRE tunnel of which the keywords are 123.

IP address

10.1.1.1/24

Tunnel protocol of the tunnel interface

gre

Enabling the checksum of a GRE tunnel

true

Keywords of a GRE tunnel

123

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>
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre">
        <checksum>true</checksum>
        <plain-text>123</plain-text>
      </gre>
     </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 GRE Security Mechanism Configuration

This section provides a sample of modifying the GRE security mechanism configuration. When the configuration on a tunnel interface is modified, the latest configuration on the tunnel interface takes effect.

Table 3-978 Modifying the GRE security mechanism configuration

Operation

XPATH

edit-config:default

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

Data Requirements
Table 3-979 Modifying the security mechanism configuration on Tunnel0/0/1

Item

Data

Description

Tunnel interface name

Tunnel0/0/1

Disable the checksum of the GRE tunnel on Tunnel0/0/1 of which the IP address is 10.1.1.1, mask length is 24, and the tunnel encryption mode is gre. Modify the keywords of the GRE tunnel to 456.

IP address

10.1.1.1/24

Tunnel protocol of the tunnel interface

gre

Enabling the checksum of a GRE tunnel

false

Keywords of a GRE tunnel

456

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> 
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre"> 
        <checksum>false</checksum> 
        <plain-text>456</plain-text> 
      </gre> 
     </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 GRE Security Mechanism Configuration

This section provides a sample of deleting the GRE security mechanism configuration.

Table 3-980 Deleting the GRE security mechanism configuration

Operation

XPATH

edit-config:remove

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

Data Requirements
Table 3-981 Deleting the security mechanism configuration on Tunnel0/0/1

Item

Data

Description

Tunnel interface name

Tunnel0/0/1

Delete the security mechanism configuration on Tunnel0/0/1 of which the IP address is 10.1.1.1, mask length is 24, and the tunnel encryption mode is gre.

IP address

10.1.1.1/24

Tunnel protocol of the tunnel interface

gre

Enabling the checksum of a GRE tunnel

false

Keywords of a GRE tunnel

456

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> 
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre" xc:operation="remove"> 
        <checksum>false</checksum> 
        <plain-text>456</plain-text> 
      </gre> 
     </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> 

Enabling the Keepalive Function of GRE

This section provides a sample of enabling the Keepalive function of GRE and specifying the time interval for sending Keepalive packets and the unreachability counter threshold.

Table 3-982 Enabling the Keepalive function of GRE

Operation

XPATH

edit-config:default

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

Data Requirements
Table 3-983 Enabling the Keepalive function of GRE on Tunnel0/0/1

Item

Data

Description

Tunnel interface name

Tunnel0/0/1

Create Tunnel0/0/1, and set the IP address to 10.1.1.1, mask length to 24, and tunnel encryption mode to gre. Enable the Keepalive function of the GRE tunnel on the interface, and set the interval at which Keepalive packets are sent to 12 and Unreachability counter threshold to 4.

IP address

10.1.1.1/24

Tunnel protocol of the tunnel interface

gre

Interval at which Keepalive packets are sent

12

Unreachability counter threshold

4

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>
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre">
        <keep-alive>
          <period>12</period>
          <retry-times>4</retry-times>
        </keep-alive>
      </gre>
     </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> 

Disabling the Keepalive Function of GRE

This section provides a sample of disabling the Keepalive function of GRE.

Table 3-984 Disabling the Keepalive function of GRE

Operation

XPATH

edit-config:remove

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

Data Requirements
Table 3-985 Disabling the Keepalive function of GRE on Tunnel0/0/1

Item

Data

Description

Tunnel interface name

Tunnel0/0/1

Create Tunnel0/0/1, set the IP address to 10.1.1.1, mask length to 24, and tunnel encryption mode to gre, and disable the Keepalive function of the GRE tunnel.

IP address

10.1.1.1/24

Tunnel protocol of the tunnel interface

gre

Interval at which Keepalive packets are sent

12

Unreachability counter threshold

4

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> 
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre" xc:operation="remove"> 
        <keep-alive> 
          <period>12</period> 
          <retry-times>4</retry-times> 
        </keep-alive> 
      </gre> 
     </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 the Identification Keyword of a GRE Tunnel

NOTE:

This function is supported in V300R003C10 and later versions.

Configuring the Identification Keyword of a GRE Tunnel

This section provides a sample of configuring the identification keyword of a GRE tunnel.

Table 3-986 Configuring the identification keyword of a GRE tunnel

Operation

XPATH

edit-config:default

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-tunnel:tunnel/huawei-gre:gre/huawei-gre:key/huawei-gre:cipher-text

Data Requirements
Table 3-987 Configuring the identification keyword of a GRE tunnel

Item

Data

Description

Tunnel protocol of the tunnel interface

gre

Set the identification keyword of a GRE tunnel to 1234.

Identification keyword

1234

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_48842817-9865-427f-b40f-85349dfe207f">
 <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-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</type>
     <enabled>true</enabled>
     <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel">
      <tunnel-type>gre</tunnel-type>
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre" xc:operation="merge">
       <cipher-text>1234</cipher-text>
      </gre>
     </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_48842817-9865-427f-b40f-85349dfe207f">
  <ok/> 
</rpc-reply> 
Changing the Identification Keyword of a GRE Tunnel

This section provides a sample of changing the identification keyword of a GRE tunnel.

Table 3-988 Changing the identification keyword of a GRE tunnel

Operation

XPATH

edit-config:replace

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-tunnel:tunnel/huawei-gre:gre/huawei-gre:key/huawei-gre:cipher-text

Data Requirements
Table 3-989 Changing the identification keyword of a GRE tunnel

Item

Data

Description

Tunnel protocol of the tunnel interface

gre

Change the identification keyword of a GRE tunnel to 12345.

Identification keyword

12345

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_48842817-9865-427f-b40f-85349dfe207f">
 <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-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</type>
     <enabled>true</enabled>
     <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel">
      <tunnel-type>gre</tunnel-type>
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre" xc:operation="replace">
       <cipher-text>12345</cipher-text>
      </gre>
     </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_48842817-9865-427f-b40f-85349dfe207f">
  <ok/> 
</rpc-reply> 
Deleting the Identification Keyword of a GRE Tunnel

This section provides a sample of deleting the identification keyword of a GRE tunnel.

Table 3-990 Deleting the identification keyword of a GRE tunnel

Operation

XPATH

edit-config:remove

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-tunnel:tunnel/huawei-gre:gre/huawei-gre:key/huawei-gre:cipher-text

Data Requirements
Table 3-991 Deleting the identification keyword of a GRE tunnel

Item

Data

Description

Tunnel protocol of the tunnel interface

gre

Delete the identification keyword 1234 of a GRE tunnel.

Identification keyword

1234

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_48842817-9865-427f-b40f-85349dfe207f">
 <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-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</type>
     <enabled>true</enabled>
     <tunnel xmlns="urn:huawei:params:xml:ns:yang:huawei-tunnel">
      <tunnel-type>gre</tunnel-type>
      <gre xmlns="urn:huawei:params:xml:ns:yang:huawei-gre" xc:operation="remove">
       <cipher-text>1234</cipher-text>
      </gre>
     </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_48842817-9865-427f-b40f-85349dfe207f">
  <ok/> 
</rpc-reply> 
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8293

Downloads: 69

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