Skip to content
Ask AI

MPLS Service

[Command] show mpls table

[Purpose] View MPLS label information

[View] System view

[Use Cases]

sonic# show mpls table
Inbound Label Type Nexthop Outbound Label
-----------------------------------------------
16 LDP 10.1.1.1 implicit-null
17 LDP 10.1.1.1 implicit-null
18 LDP 10.1.1.1 16

[Command] mpls enable

[Purpose] Enable mpls function

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# interface ethernet 18
sonic(config-if-18)# mpls enable

[Command] filter-listfilter-name**{seqnumberpermit {ip-address|any}|permit {ip-address|any}|remarkString}**

[Purpose] Configure MPLS label filtering policies based on IPv4 address families

[Parameter]

ParameterDescription
seq numberConfigure the rule ID. If not configured, the default increment for each dispatch is 5. Configuration range: 1 to 4,294,967,295
permit ip-addressConfigure MPLS label filtering conditions, supporting IP address filtering in both A.B.C.D/M and A.B.C.D formats.
permit anyConfigure Transparent MPLS Label Filtering Policy
remark StringSet description information for the tag policy

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# filter-list test permit 1.1.1.1

[Command] ipv6 filter-listfilter-name**{seqnumberpermit {ipv6-address|any}|permit {ipv6-address|any}|remarkString}**

[Purpose] Configure MPLS label filtering policies based on IPv6 address families

[Parameter]

ParameterDescription
seq numberConfigure the rule ID. If not configured, the default increment for each dispatch is 5. Configuration range: 1 to 4,294,967,295
permit ip-addressConfigure MPLS label filtering conditions, supporting IP address filtering in bothX:X::X:X/M and X:X::X:X formats.
permit anyConfigure Transparent MPLS Label Filtering Policy
remark StringSet description information for the tag policy

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# ipv6 filter-list test permit fe80::1

[Command] mpls ldp

[Purpose] Enter MPLS LDP view

[View] System configuration view

[Use Cases]

sonic(config)# mpls ldp
sonic(config-ldp)#

[Command] ip routeA.B.C.D/M|A.B.C.D gwlabelnumber

[Purpose] Configure IPv4 Route Forwarding with MPLS Labeling

[Parameter]

ParameterDescription
A.B.C.D/M|A.B.C.DIPv4 address or network segment
gwNext hop address of the router
numberMPLS label ID to be marked, configuration range: 16 to 1048575

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# ip route 1.1.1.1/24 1.1.1.1 label 100

[Command] ipv6 routeA.B.C.D/M|A.B.C.D gwlabelnumber

[Purpose] Configure IPv6 Route Forwarding with MPLS Labeling

[Parameter]

ParameterDescription
X:X::X:X/MIPv6 network segment
gwNext hop address of the router
numberMPLS label ID to be marked, configuration range: 16 to 1048575

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# ipv6 route 2000::/64 2024::1 label 100

[Command] mpls lspnumber A.B.C.D|X:X::X:X**{number|explicit-null|implicit-null}**

[Purpose] Configure MPLS Static Label Processing Policy

[Parameter]

ParameterDescription
numberMPLS label ID to be marked, configuration range: 16 to 1048575
A.B.C.D|X:X::X:XIPv4 or IPv6 address of the next hop
explicit-nullThe MPLS label in the neighbor notification message will be set to explicit-null (0). Upon receiving the message, the neighbor will automatically drop this MPLS label.
implicit-nullInform the neighbor that it is currently the second-to-last hop in the MPLS path and pop the MPLS label here.

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls lsp 100 10.1.1.2 200

[Command] show mpls ldp neighbor

[Purpose] View MPLS LDP Neighbor Relationships

[View] System view

[Use Cases]

sonic# show mpls ldp neighbor
AF ID State Remote Address Uptime
ipv4 2.2.2.2 OPERATIONAL 2.2.2.2 01:02:51

[Command] show mpls ldp binding

[Purpose] View MPLS LDP label information

[Parameter]

ParameterDescription
Local LabelHow locally marked MPLS labels are applied to packets and communicated to neighbors
Remote LabelReceived from the neighbor regarding how to mark MPLS labels on packets
In UseIf it being used by the device
imp-nullInform other neighbors that this is the final MPLS node in the local network, instructing them to drop the MPLS label when transmitting packets.

[View] System view

[Use Cases]

sonic# show mpls ldp binding
AF Destination Nexthop Local Label Remote Label In Use
ipv4 1.1.1.1/32 2.2.2.2 imp-null 20 no
ipv4 2.2.2.2/32 2.2.2.2 17 imp-null yes
ipv4 3.3.3.3/32 2.2.2.2 18 16 yes
ipv4 10.1.1.0/24 2.2.2.2 imp-null imp-null no
ipv4 16.0.0.0/24 2.2.2.2 19 17 yes
ipv4 20.1.1.0/24 2.2.2.2 16 imp-null yes
ipv4 192.168.1.0/24 2.2.2.2 20 imp-null yes
ipv4 192.168.2.0/24 2.2.2.2 imp-null 22 no
ipv4 192.168.3.0/24 2.2.2.2 21 18 yes

[Command] show mpls ldp neighbor detail

[Purpose] View MPLS LDP Neighbor Negotiation Parameters

[View] System view

[Use Cases]

sonic# show mpls ldp neighbor detail
Peer LDP Identifier: 2.2.2.2:0
TCP connection: 1.1.1.1:646 - 2.2.2.2:34173
Authentication: none
Session Holdtime: 180 secs; KeepAlive interval: 60 secs
State: OPERATIONAL; Downstream-Unsolicited
Up time: 01:05:38
Messages sent/rcvd:
- Keepalive Messages: 64/66
- Address Messages: 3/1
- Address Withdraw Messages: 1/0
- Notification Messages: 0/0
- Capability Messages: 0/0
- Label Mapping Messages: 15/11
- Label Request Messages: 0/0
- Label Withdraw Messages: 0/0
- Label Release Messages: 0/0
- Label Abort Request Messages: 0/0
Capabilities Sent:
- Dynamic Announcement (0x0506)
- Typed Wildcard (0x050B)
- Unrecognized Notification (0x0603)
Capabilities Received:
- Dynamic Announcement (0x0506)
- Typed Wildcard (0x050B)
- Unrecognized Notification (0x0603)
LDP Discovery Sources:
IPv4:
Interface: Ethernet16

[Command] mpls ldp

[Purpose] Enable MPLS LDP on the interface

[View] Interface configuraton view

[Use Cases]

sonic# configure
sonic(config)# interface ethernet 1
sonic(config-if-1)# mpls ldp

[Command] dual-stack cisco-interop

[Purpose] Enable MPLS LDP dual-stack neighbor establishment

[View] MPLS LDP configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# dual-stack cisco-interop

[Command] router-idip-address

[Purpose] Configure the router-id of MPLS LDP

[Parameter]

ParameterDescription
ip-addressName the router-id in the format of an ipv4 address

[View] MPLS LDP configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# router-id 1.1.1.1

dual-stack transport-connection prefer ipv4

Section titled “dual-stack transport-connection prefer ipv4”

[Command] dual-stack transport-connection prefer ipv4

[Purpose] MPLS dual stack uses IPv4 to transmit LDP information

[Notes] Dual-stack neighbor establishment defaults to transmitting LDP information over IPv6.

[View] MPLS LDP configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# dual-stack transport-connection prefer ipv4

[Command] **rdiscovery hello {holdtime|interval}**VALUE

[Purpose] Configure the keepalive period and transmission interval for MPLS LDP Hell packets

[Parameter]

ParameterDescription
holdtimeSet the keepalive interval for hello packets
intervalSet the transmission interval for hello packets
VALUETime (Unit: seconds), Configuration Range: 1-65535

[View] MPLS LDP configuration view

[Notes] The keepalive period and transmission interval configured for hello packets in this view take effect globally. The keepalive period for hello packets is determined through negotiation with the peer device, adopting the minimum value from both ends as the keepalive period.

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# discovery hello interval 10
sonic(config-ldp)# discovery hello holdtime 20

[Command] address-familyipv4|ipv6

[Purpose] Enter the ipv4 or ipv6 address-family

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)#

[Command] ordered-control

[Purpose] Configure MPLS LDP for Label Ordering Control Mode

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# ordered-control

[Command] neighborLDP-ID**{passwordString|session {holdtime|interval}Time|ttl-security {disable|hopsHops}}**

[Purpose] Configure relevant parameters for the specified LDP neighbor

[Parameter]

ParameterDescription
LDP-IDSpecify the router-id of the LDP neighbor
password StringTo establish an LDP neighbor, the keys at both ends must match for successful neighbor establishment
session interval TimeSet the interval for sending LDP Keepalive messages to specified neighbors. Configuration range: 5 to 65535, unit: seconds. Default: 60 seconds.
session holdtime TimeSet the LDP Keepalive aging period for specified neighbors. Configuration range: 15 to 65535 seconds. Unit: seconds. Default: 300 seconds.
ttl-security hops HopsSet the hop count for specifying remote neighbors. If exceeded, the neighbor relationship is terminated. Configuration range: 1-254. Default: disabled.
ttl-security disableDisable hop count restrictions with specified remote neighbors

[View] MPLS LDP configuration view

[Notes] A timeout in either the LDP Keepalive or LDP Hello message will cause the neighbor relationship to break.

When configuring hop count with a remote neighbor, the neighbor relationship is maintained if only one party meets the hop count setting.

The priority of the LDP Keepalive message interval specified in the neighbor configuration takes precedence over the LDP Keepalive message interval configured in the address family configuration view.

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# neighbor 192.168.15.119 ttl-security hops 100
sonic(config-ldp)# neighbor 192.168.15.119 session interval 60
sonic(config-ldp)# neighbor 192.168.15.119 password 123456

[Command] exit-address-family

[Purpose] Exit Address Family Configuration Mode

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# exit-address-family

[Command] **discovery {hello holdtime|interval}**Time

[Purpose] Configure address family-based LDP hello message transmission and aging cycle

[Parameter]

ParameterDescription
holdtime TimeConfigure the aging period for LDP Hello messages. Range: 1 to 65535, unit: seconds. Default: 15 seconds.
interval TimeConfigure the transmission interval for LDP hello packets. Range: 1 to 65535, unit: seconds. Default: 5 seconds.

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery hello holdtime 10

[Command] discovery transport-addressip-address

[Purpose] Configure the IPv4/IPv6 addresses advertised by the LDP address family

[Parameter]

ParameterDescription
ip-addressThis parameter is typically configured as the IP address of the interconnect interface.

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# discovery transport-address 100.1.1.1

[Command] neighborip-addresstargeted

[Purpose] Establish a neighbor relationship with a remote LDP neighbor

[Parameter]

ParameterDescription
ip-addressIP information advertised externally by the peer during neighbor establishment

[View] MPLS LDP address-family configuration view

[Notes] The IP address configured here is the one advertised when establishing the LDP neighbor, not a custom router ID.

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# neighbor 100.1.3.2 targeted

[Command] ttl-security disable

[Purpose] Disable ttl-security

[View] MPLS LDP address-family configuration view

[Notes] This command must be executed when using MPLS IPv6 scenarios.

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv6
sonic(config-ldp-af)# ttl-security disable

[Command] **session {holdtime|interval}**Time

[Purpose] Configuring LDP Keepalive Message Transmission and Aging Periods Based on Address Families

[Parameter]

ParameterDescription
holdtime TimeConfiguration Range: 15–65535, Unit: seconds, Default Value: 300 seconds
interval TimeConfiguration Range: 5 to 65535, Unit: seconds, Default Value: 60 seconds

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv4
sonic(config-ldp-af)# session interval 60

[Command] label local advertise {tofilter-name**|forfilter-name|explicit-null|explicit-null forfilter-name}**

[Purpose] MPLS Label Policy for Local Reception or Declaration Based on Address Family Binding

[Parameter]

ParameterDescription
filter-nameName of the MPLS Neighbor Filtering Policy
to filter-nameOnly send MPLS label information for neighbors that meet the filtering criteria
for filter-nameSend only MPLS label information for routes that meet the filtering criteria
explicit-nullEnable MPLS label popping at the last-hop device
explicit-null for filter-nameMPLS label last-hop pop occurs only on routes that comply with the filtering policy

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv6
sonic(config-ldp-af)# label local advertise explicit-null for test

[Command] label local allocate {host-routes|forfilter-name**}**

[Purpose] Address Family-Based Binding of Local Marking MPLS Labeling Policy

[Parameter]

ParameterDescription
host-routesEnable MPLS label assignment only for local host routing.
for filter-nameAssign MPLS labels only to routes that match the filtering policy.

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv6
sonic(config-ldp-af)# label local allocate for test

[Command] label remote accept {fromfilter-name**|forfilter-name}**

[Purpose] MPLS Labeling Strategy Based on Address Family Binding Neighbor Route Declaration

[Parameter]

ParameterDescription
from filter-nameOnly receive MPLS label information advertised by neighbors that comply with the filtering policy.
for filter-nameOnly accept MPLS label information that conforms to the filtering policy routing.

[View] MPLS LDP address-family configuration view

[Use Cases]

sonic# configure
sonic(config)# mpls ldp
sonic(config-ldp)# address-family ipv6
sonic(config-ldp-af)# label remote accept

[Command] show mpls l2vpn

[Purpose] View MPLS L2VPN information

[View] Syetem view

[Use Cases]

sonic# show mpls l2vpn
VPN Name VPN Type AC Interface Pseudowires
---------- ---------- -------------- -------------
test vpls Vlan100 220

[Command] show mpls pseudowires

[Purpose] View MPLS PW information

[View] Syetem view

[Use Cases]

sonic# show mpls pseudowires
Interface Neighbor Labels Protocol Status
0 20.2.2.1 16/17 static UP

[Command] show mpls pseudowires detail

[Purpose] View detailed output information for MPLS PWs

[View] Syetem view

[Use Cases]

sonic(config-if-16)# do show mpls pseudowires detail
Interface: 220
Neighbor: 3.3.3.3
Local Label: 16
Remote Label: 21
Protocol: ldp
VC-ID: 1
Status: Up
Next Hop: 10.1.1.1, via Ethernet16
Next Hop label: 18

[Command] spseudowire staticname

[Purpose] Configure static password

[View] Syetem configuration view

[Notes] Manually specify the address of the remote PE and statically configure the MPLS labels for both ingress and egress directions of the PW. After binding the L2VPN instance, this provides a virtual connection for packet forwarding between different sites.

[Use Cases]

sonic# configure
sonic(config)# pseudowire static pw1

[Command] mpls label localnumberremotenumber

[Purpose] Configure the local and remote labels for static pseudowires

[Parameter]

ParameterDescription
numberValue range: 16–1048575

[View] PW configuration view

[Use Cases]

sonic# configure
sonic(config)# pseudowire static pw1
sonic(config-static-pw)# mpls label local 16 remote 17

[Command] neighbor {A.B.C.D|X:X::X:X }

[Purpose] Configure the static remote neighbor address for the static PW.

[Parameter]

ParameterDescription
A.B.C.DRemote PW’s IPv4 neighbor address
X:X::X:XRemote PW’s IPv6 neighbor address

[View] PW configuration view

[Use Cases]

sonic# configure
sonic(config)# pseudowire static pw1
sonic(config-static-pw)# neighbor 10.1.1.1

[Command] npseudowirename

[Purpose] Configure Dynamic PW

[Parameter]

ParameterDescription
nameCustom PW Name, String type

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# pseudowire pw

[Command] pw-idID

[Purpose] Configure the dynamic PW’s pw-id

[Parameter]

ParameterDescription
IDAllowable value range: 1–4,294,967,295

[View] PW configuration view

[Notes] The PW-ID configured on PE devices connected to adjacent ends must be consistent for the PW state to be up.

[Use Cases]

sonic# configure
sonic(config)# pseudowire pw1
sonic(config-pw)# pw-id 1

[Command] neighbor lsr-idA.B.C.D

[Purpose] Configure dynamic PW lsr-id

[Parameter]

ParameterDescription
A.B.C.DPW Neighbor’s IPv4 Address

[View] PW configuration view

[Use Cases]

sonic# configure
sonic(config)# pseudowire pw1
sonic(config-pw)# neighbor lsr-id 1.1.1.1

[Command] pw-status disable no pw-status disable

[Purpose] Modify the status of the dynamic password

[View] PW configuration view

[Use Cases]

sonic# configure
sonic(config)# pseudowire pw1
sonic(config-pw)# pw-status disable

[Command] L2vpnnametype {vpls|vpws}

[Purpose] Configure different L2VPN types—VPLS and VPWS—based on specific usage scenarios.

[Parameter]

ParameterDescription
vplsVirtual Private LAN Service (VPLS) is a point-to-multipoint Layer 2 Virtual Private Network (L2VPN).
vpwsVirtual Private Network service is a point-to-point L2VPN.

[View] System configuration view

[Use Cases]

sonic# configure
sonic(config)# l2vpn VPLS type vpls

[Command] member pseudowirename

[Purpose] Add PW members to the existing L2VPN.

[Parameter]

ParameterDescription
nameStatic or Dynamic PW Name

[View] L2VPN configuration view

[Use Cases]

sonic# configure
sonic(config)# l2vpn VPLS type vpls
sonic(config-l2vpn)# member pseudowire pw1
Section titled “member interface {ethernet|vlan|link-aggregation}”

[Command] member interface {ethernet|vlan|link-aggregation}

[Purpose] Add an AC interface to the existing L2VPN.

[Parameter]

ParameterDescription
ethernetPhysical interface
vlanVlan interface
link-aggregationLag interface

[Notes] VPLS only supports VLAN interfaces, while VPWS only supports physical interfaces and LAG interfaces.

[View] L2VPN configuration view

[Use Cases]

sonic# configure
sonic(config)# l2vpn VPLS type vpls
sonic(config-l2vpn)# member interface ethernet 1

[Command] show {ipv4|ipv6} route vrf all

[Purpose] View the routing and MPLS label information for all VRFs currently configured on the device.

[View] System configuration view

[Use Cases]

sonic# show ip route vrf all
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
VRF l3vpn:
B> 10.1.0.1/32 [200/0] via 3.3.3.3 (vrf default) (recursive), label 144, weight 1, 01:46:43
* via 10.1.1.1, Ethernet16 (vrf default), label 16/144, weight 1, 01:46:43
B> 90.0.0.0/24 [200/0] via 3.3.3.3 (vrf default) (recursive), label 144, weight 1, 01:46:43
* via 10.1.1.1, Ethernet16 (vrf default), label 16/144, weight 1, 01:46:43
B> 192.168.1.0/24 [200/0] via 3.3.3.3 (vrf default) (recursive), label 144, weight 1, 01:46:43
* via 10.1.1.1, Ethernet16 (vrf default), label 16/144, weight 1, 01:46:43
B> 192.168.2.0/24 [200/0] via 3.3.3.3 (vrf default) (recursive), label 144, weight 1, 01:46:43
* via 10.1.1.1, Ethernet16 (vrf default), label 16/144, weight 1, 01:46:43
B> 192.168.3.0/24 [200/0] via 3.3.3.3 (vrf default) (recursive), label 144, weight 1, 01:46:43
* via 10.1.1.1, Ethernet16 (vrf default), label 16/144, weight 1, 01:46:43
B> 192.168.6.0/24 [200/0] via 3.3.3.3 (vrf default) (recursive), label 144, weight 1, 01:46:43
* via 10.1.1.1, Ethernet16 (vrf default), label 16/144, weight 1, 01:46:43
VRF default:
S>* 0.0.0.0/0 [1/0] via 192.168.2.1, Ethernet1, weight 1, 03:39:43
C>* 1.1.1.1/32 is directly connected, Loopback0, 03:39:29
O>* 2.2.2.2/32 [110/20] via 10.1.1.1, Ethernet16, label implicit-null, weight 1, 01:46:51
O>* 3.3.3.3/32 [110/20] via 10.1.1.1, Ethernet16, label 16, weight 1, 01:46:51
O 10.1.1.0/24 [110/10] is directly connected, Ethernet16, weight 1, 01:47:47
C>* 10.1.1.0/24 is directly connected, Ethernet16, 01:47:47
O>* 16.0.0.0/24 [110/20] via 10.1.1.1, Ethernet16, label 17, weight 1, 01:46:51
O>* 20.1.1.0/24 [110/10010] via 10.1.1.1, Ethernet16, label implicit-null, weight 1, 01:46:52
O>* 192.168.1.0/24 [110/20] via 10.1.1.1, Ethernet16, label implicit-null, weight 1, 01:46:51
C>* 192.168.2.0/24 is directly connected, Ethernet1, 03:39:43
O>* 192.168.3.0/24 [110/20] via 10.1.1.1, Ethernet16, label 18, weight 1, 01:46:51

[Command] saddress-family {ipv4|ipv6} vpn

[Purpose] Enter ipv4/ipv6 MPLS VPN view

[View] BGP configuration view

[Use Cases]

sonic# configure
sonic(config)# router bgp 200
sonic(config-router)# address-family ipv6 vpn
sonic(config-router-af)#

[Command] neighbor {A.B.C.D|X:X::X:X } activate

[Purpose] Activate the MPLS VPN neighbor. Once activated, the neighbor can propagate MPLS VPN routes.

[View] MPLS VPN configuration view

[Use Cases]

sonic# configure
sonic(config)# router bgp 200
sonic(config-router)# address-family ipv6 vpn
sonic(config-router-af)# neighbor 1111::1 activate

label vpn export {auto|allocation-mode {per-vrf|per-nexthop}|

Section titled “label vpn export {auto|allocation-mode {per-vrf|per-nexthop}|”

[Command] label vpn export {auto|allocation-mode {per-vrf|per-nexthop}|Label-number}

[Purpose] Configure MPLS VPN Label Assignment Method

[Parameter]

ParameterDescription
autoAutomatically assign MPLS labels to routes
allocation-modeper-vrf Routes are assigned labels based on the VRF; routes within the same VRF are assigned the same label.
allocation-modeper-nexthop Assign labels based on the next hop of the route; routes with the same next hop are assigned the same label.
Label-numberManually set the MPLS label assigned to the route

[View] BGP configuration view

[Use Cases]

sonic# configure
sonic(config)# router bgp 200 vrf 1
sonic(config-router)# address-family ipv6 unicast
sonic(config-router-af)# label vpn export auto

[Command] mpls bgp l3vpn-multi-domain-switching

[Purpose] Redistribute labeled L3VPN routes from the AS to neighboring ASes

[View] Interface configuration view

[Notes] The mpls bgp l3vpn-multi-domain-switching configuration on an interface is used to convert VPN labels into BGP labels. However, it must be configured before BGP is configured; otherwise, it will not take effect. It is recommended that after configuring this command on an interface, the user be prompted to execute clear bgp * to reset all BGP sessions and regenerate BGP labels.

[Use Cases]

sonic# configure
sonic(config)# interface ethernet 2
sonic(config-if-2)# mpls bgp l3vpn-multi-domain-switching

[Command] rd vpn export {as-number:number|ip-address:number}

[Purpose] Configuring RD Parameters for an MPLS VPN

[Parameter]

ParameterDescription
as-number:numberHQoS configuration file name
ip-address:numberRD parameter configuration format, for example: 1.1.1.1:2

[View] BGP configuration view

[Notes] RD parameters are designed to resolve conflicts where internal networks at both ends of a VPN share the same route segment. RD is combined with the VPN prefix (VPNv4 address) to form a unique VPNv4 address. This combination of RD and VPN prefix creates a new routing entry, enabling each VPN route to be uniquely identified.

[Use Cases]

sonic# configure
sonic(config)# router bgp 200 vrf 1
sonic(config-router)# address-family ipv6 unicast
sonic(config-router-af)# rd vpn export 2:2

rt vpn {import|export|both} {A.B.C.D:MN|EF:OPQR|GHJK:MN}

Section titled “rt vpn {import|export|both} {A.B.C.D:MN|EF:OPQR|GHJK:MN}”

[Command] rt vpn {import|export|both} {A.B.C.D:MN |EF:OPQR |GHJK:MN }

[Purpose] Configuring the RT Parameters for an MPLS VPN

[Parameter]

ParameterDescription
importConfigure RT parameters for receiving VPN routes
exportConfigure RT parameters for sending VPN routes
bothConfigure RT parameters for both receiving and sending VPN routes simultaneously.
A.B.C.D:MNRT parameter format, for example: 1.1.1.1:22
EF:OPQRRT parameter format, for example: 11:2222
GHJK:MNRT parameter format, for example: 1111:22

[View] BGP configuration view

[Notes] RT parameters control the identifiers used for exporting and importing VPN routes, ensuring that VPN routes are correctly sent and received between different VPNs.

[Use Cases]

sonic# configure
sonic(config)# router bgp 200 vrf 1
sonic(config-router)# address-family ipv6 unicast
sonic(config-router-af)# rt vpn both 2:2

[Command] {export|import} vpn

[Purpose] Export/Import VPN Routes

[View] BGP configuration view

[Use Cases]

sonic# configure
sonic(config)# router bgp 200 vrf 1
sonic(config-router)# address-family ipv6 unicast
sonic(config-router-af)# import vpn
sonic(config-router-af)# export vpn