This section provides a sample of configuring basic MPLS functions using the edit-config method.
Operation |
XPATH |
|---|---|
edit-config |
|
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 |
<?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>
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>