Tunnel Policy Configuration
This section describes the configuration model of tunnel policy management and provides examples of XML packets.
Data Model
The configuration model file matching tunnel policy management is huawei-tnlm.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tnlPolicyName |
Indicates the tunnel policy. |
The value is a string of 1 to 39 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces. |
N/A |
/huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tnlPolicyType |
Indicates the tunnel policy type. |
The value is of the enumerated type:
The default value is Invalid. |
N/A |
/huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tpNexthops/tpNexthop/nexthopIPaddr |
Indicates the destination address of the tunnel. |
The value is in dotted decimal notation. |
N/A |
/huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tpNexthops/tpNexthop/tpTunnels/tpTunnel/tunnelName |
Indicates the tunnel name. |
The value is a string of 1 to 39 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces. |
N/A |
Configuring a Tunnel Policy
This section provides a sample of configuring a tunnel policy using the edit-config:merge method.
Operation |
XPATH |
---|---|
edit-config:merge |
|
Data Requirements
Item |
Data |
Description |
---|---|---|
Tunnel policy name |
jk |
Set the tunnel policy name. |
Tunnel policy type |
tnlBinding |
Set the tunnel policy type. |
Destination address of the tunnel |
nexthopIPaddr |
Set the destination address of the tunnel. |
Tunnel name |
Tunnel3 |
Set the tunnel name. |
Request Example
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"> <edit-config> <target> <running/> </target> <config> <tnlm:tnlm xmlns:tnlm="http://www.huawei.com/netconf/vrp/huawei-tnlm"> <tnlm:tunnelPolicys> <tnlm:tunnelPolicy> <tnlm:tnlPolicyName>jk</tnlm:tnlPolicyName> <tnlm:tnlPolicyType>tnlBinding</tnlm:tnlPolicyType> <tnlm:tpNexthops> <tnlm:tpNexthop> <tnlm:nexthopIPaddr>2.2.2.3</tnlm:nexthopIPaddr> <tnlm:tpTunnels> <tnlm:tpTunnel> <tnlm:tunnelName>Tunnel3</tnlm:tunnelName> </tnlm:tpTunnel> </tnlm:tpTunnels> </tnlm:tpNexthop> </tnlm:tpNexthops> </tnlm:tunnelPolicy> </tnlm:tunnelPolicys> </tnlm:tnlm> </config> </edit-config> </rpc>
Response Example
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <ok/> </rpc-reply>
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>The configuration/operation does not support.</error-message> <error-info>Error on node /huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy[tnlPolicyName="jk"]/tpNexthops/tpNexthop[nexthopIPaddr="2.2.2.3"]</error-info> </rpc-error> </rpc-reply>