MPLS
This section describes the configuration model of MPLS and provides examples of XML packets.
Data Model
The configuration model files matching MPLS are huawei-mpls.yang, huawei-mpls-ldp.yang, huawei-mpls-te.yang, huawei-mpls-comm.yang, and huawei-ospf.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-mpls:mpls/mplsCommon/mplsCommonCfg/mplsLsrID |
Indicates the LSR ID of a device. The LSR ID is used to identify an LSR. |
The value is in dotted decimal notation. |
|
/huawei-mpls:mpls/mplsCommon/mplsCommonCfg/mplsEnable |
Indicates whether MPLS is enabled globally. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsCommon/mplsCommonCfg/teEnable |
Indicates whether MPLS traffic engineering (MPLS TE) is enabled globally. |
The value is of the Boolean type:
The default value is false. |
MPLS needs to be globally enabled first. |
/huawei-mpls:mpls/mplsCommon/mplsCommonCfg/rsvpTeEnable |
Indicates whether RSVP-TE is enabled globally. |
The value is of the Boolean type:
The default value is false. |
MPLS TE needs to be globally enabled first. |
/huawei-mpls:mpls/mplsCommon/mplsCommonCfg/ldpEnable |
Indicates whether MPLS LDP is enabled globally. |
The value is of the Boolean type:
The default value is false. |
MPLS needs to be globally enabled first. |
/huawei-mpls:mpls/mplsCommon/mplsInterfaces/mplsInterface/interfaceName |
Specifies the interface name and enables MPLS on the interface. |
The interface must already exist on the device. |
The interface must already be configured in the /if:interfaces/if:interface/if:name. |
/huawei-mpls:mpls/mplsCommon/mplsInterfaces/mplsInterface/ldpEnable |
Indicates whether MPLS LDP is enabled on an interface. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsCommon/mplsInterfaces/mplsInterface/mplsTEEnable |
Indicates whether MPLS TE is enabled on an interface. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsCommon/mplsInterfaces/mplsInterface/rsvpTEEnable |
Indicates whether RSVP-TE is enabled on an interface. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsLdp/ldpInstances/ldpInstance/vrfName |
Indicates the VRF name. |
The value is _public_. |
N/A |
/huawei-mpls:mpls/mplsLdp/ldpInstances/ldpInstance/ldpRemotePeers/ldpRemotePeer/remotePeerName |
Indicates the remote MPLS LDP peer name. |
The value is a string of 1 to 32 case-insensitive characters without spaces. |
MPLS LDP needs to be globally enabled first. |
/huawei-mpls:mpls/mplsLdp/ldpInstances/ldpInstance/ldpRemotePeers/ldpRemotePeer/remoteIp |
Indicates the IP address of the remote MPLS LDP peer. |
The value is in dotted decimal notation. The IP address cannot be the interface IP address of the local device. |
N/A |
/huawei-mpls:mpls/mplsTe/cspfCfg/enableCspf |
Indicates whether CSPF is enabled. |
The value is of the Boolean type:
The default value is false. |
MPLS TE needs to be globally enabled first. |
/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/huawei-ospf:ospf/instance/opaque-capability-enable |
Indicates whether the Opaque capability of OSPF is enabled. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsCommon/ospfTEs/ospfTE/processID |
Indicates the OSPF process ID. |
The OSPF process must already exist. |
N/A |
/huawei-mpls:mpls/mplsCommon/ospfTEs/ospfTE/area |
Indicates the OSPF area ID. |
The OSPF area must already exist. |
N/A |
/huawei-mpls:mpls/mplsCommon/ospfTEs/ospfTE/enable |
Indicates whether MPLS TE is enabled in the specified OSPF area. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/tunnelName |
Specifies a tunnel interface and sets the tunneling protocol to MPLS TE. |
The value is a character string consisting of Tunnel and the tunnel interface number, for example, Tunnel20. The tunnel interface number ranges from 0 to 16383. |
|
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/mplsTunnelEgressLSRId |
Indicates the destination address of a tunnel interface. |
The value is in dotted decimal notation. |
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/mplsTunnelIndex |
Indicates the tunnel ID. |
The value is an integer that ranges from 1 to 10000. |
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/UserDefinedName |
Indicates the TE tunnel name. |
The value is a string of 1 to 63 case-sensitive characters without spaces or slashes (/). The initial character of the value must be an underscore (_) or an English letter, not a digit. |
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/mplsTunnelRecordRoute |
Indicates whether the route and label recording functions are enabled during tunnel establishment. |
The value can be:
|
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/frrAttr/frrEnable |
Indicates whether the FRR function is enabled. |
The value is of the Boolean type:
The default value is false. |
A tunnel interface cannot be used for both a bypass tunnel and a primary tunnel, that is, the mpls te fast-reroute and mpls te bypass-tunnel commands cannot be configured together on the tunnel interface. |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/reoptimization |
Indicates whether automatic re-optimization is enabled for a tunnel. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/resvForBinding |
Indicates whether a TE tunnel is reserved for VPN binding. |
The value is of the Boolean type:
The default value is false. |
N/A |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/bypassAttr/bypassEnable |
Indicates whether a bypass tunnel is specified for MPLS TE auto FRR. |
The value is of the Boolean type:
The default value is false. |
A tunnel interface cannot be used for both a bypass tunnel and a primary tunnel, that is, the mpls te fast-reroute and mpls te bypass-tunnel commands cannot be configured together on the tunnel interface. A tunnel interface cannot be used for both a bypass tunnel and a protection tunnel in a tunnel protection group. A protection failure will occur if the mpls te bypass-tunnel and mpls te protection tunnel commands are both configured on the tunnel interface. |
/huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/bypassAttr/bypassProtectIFs/bypassProtectIF/bypassProtectIFName |
Specifies the interface to be protected by a bypass tunnel. |
The interface must already exist on the device. |
MPLS TE must be enabled on the interface to be protected. |
/huawei-mpls:mpls/mplsTe/mplsTeSite/autoFrrEnable |
Indicates whether TE auto FRR is enabled. |
The value is of the Boolean type:
The default value is false. |
MPLS TE needs to be globally enabled first. |
/huawei-mpls:mpls/mplsTe/teLinks/teLink/interfaceName |
Specifies the interface on which TE auto FRR is to be configured. |
The interface must already exist on the device. |
MPLS TE must be enabled first on the interface. |
/huawei-mpls:mpls/mplsTe/teLinks/teLink/autoFrrMode |
Indicates whether TE auto FRR is configured on a specified interface. |
The value can be:
|
MPLS TE must be enabled first on the interface. |
Configuring Basic MPLS Functions
This section provides a sample of configuring basic MPLS functions using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
|
Data Requirements
Item |
Data |
---|---|
LSR ID |
10.1.1.2 |
Whether MPLS is enabled globally |
true |
Whether MPLS TE is enabled globally |
true |
Whether RSVP-TE is enabled globally |
true |
Whether LDP is enabled globally |
true |
Name of the interface on which MPLS is enabled |
Vlanif3 |
Whether MPLS LDP is enabled on an interface |
true |
Whether MPLS TE is enabled on an interface |
true |
Whether RSVP-TE is enabled on an interface |
true |
Whether CSPF is enabled |
true |
Type of the Vlanif3 interface |
iana-if-type:propVirtual |
Request Example
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <edit-config> <target> <running/> </target> <config> <mpls:mpls xmlns:mpls="http://www.huawei.com/netconf/vrp/huawei-mpls"> <mpls:mplsCommon> <mpls:mplsCommonCfg> <mpls:mplsLsrID>10.1.1.2</mpls:mplsLsrID> <mpls:mplsEnable>true</mpls:mplsEnable> <mpls:teEnable>true</mpls:teEnable> <mpls:rsvpTeEnable>true</mpls:rsvpTeEnable> <mpls:ldpEnable>true</mpls:ldpEnable> </mpls:mplsCommonCfg> <mpls:mplsInterfaces> <mpls:mplsInterface> <mpls:interfaceName>Vlanif3</mpls:interfaceName> <mpls:ldpEnable>true</mpls:ldpEnable> <mpls:mplsTEEnable>true</mpls:mplsTEEnable> <mpls:rsvpTEEnable>true</mpls:rsvpTEEnable> </mpls:mplsInterface> </mpls:mplsInterfaces> </mpls:mplsCommon> <mpls:mplsTe> <mpls:cspfCfg> <mpls:enableCspf>true</mpls:enableCspf> </mpls:cspfCfg> </mpls:mplsTe> </mpls:mpls> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>Vlanif3</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual</if:type> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?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="0"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message> Please configure mpls lsr-id first.</error-message> <error-info>Error on node /huawei-mpls:mpls/mplsCommon/mplsCommonCfg/mplsEnable</error-info> </rpc-error> </rpc-reply>
Configuring a Remote LDP Session
This section provides a sample of configuring a remote LDP session using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
|
Data Requirements
Item |
Data |
---|---|
LSR ID |
10.1.1.1 |
Whether MPLS is enabled globally |
true |
Whether LDP is enabled globally |
true |
VRF name |
_public_ |
Name of a remote peer |
LSRC |
IP address of a remote MPLS LDP peer |
10.2.1.1 |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="11" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <mpls:mpls xmlns:mpls="http://www.huawei.com/netconf/vrp/huawei-mpls"> <mpls:mplsCommon> <mpls:mplsCommonCfg> <mpls:mplsLsrID>10.1.1.1</mpls:mplsLsrID> <mpls:mplsEnable>true</mpls:mplsEnable> <mpls:ldpEnable>true</mpls:ldpEnable> </mpls:mplsCommonCfg> </mpls:mplsCommon> <mpls:mplsLdp> <mpls:ldpInstances> <mpls:ldpInstance> <mpls:vrfName>_public_</mpls:vrfName> <mpls:ldpRemotePeers> <mpls:ldpRemotePeer> <mpls:remotePeerName>LSRC</mpls:remotePeerName> <mpls:remoteIp>10.2.1.1</mpls:remoteIp> </mpls:ldpRemotePeer> </mpls:ldpRemotePeers> </mpls:ldpInstance> </mpls:ldpInstances> </mpls:mplsLdp> </mpls:mpls> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="11"> <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="4"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>The remotePeerName has already existed.</error-message> <error-info>Error on node /huawei-mpls:mpls/mplsLdp/ldpInstances/ldpInstance[vrfName="_public_"]/ldpRemotePeers/ldpRemotePeer[remotePeerName="LSRC"]</error-info> </rpc-error> </rpc-reply>