< Home

Configuring a Tunnel Policy

This section provides a sample of configuring a tunnel policy using the edit-config:merge method.

Table 1 Configuring a tunnel policy

Operation

XPATH

edit-config:merge

  • /huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tnlPolicyName
  • /huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tnlPolicyType
  • /huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tpNexthops/tpNexthop/nexthopIPaddr
  • /Huawei-tnlm:tnlm/tunnelPolicys/tunnelPolicy/tpNexthops/tpNexthop/tpTunnels/tpTunnel/tunnelName

Data Requirements

Table 2 Configuring a tunnel policy

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

Sample of successful response
##### 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>
Sample of failed response
<?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>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic