---
title: MPLS Service
slug: routing/mpls-service
description: MPLS Service
createdAt: 2026-02-05T02:50:30.938Z
---

## <font color="#1d50a2">MPLS Configuration</font>

### <font color="#1d50a2">show mpls table</font>

**\[Command]**
**show mpls table**

**\[Purpose]**
View MPLS label information

**\[View]**
System view

**\[Use Cases]**

```plaintext
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
```

### <font color="#1d50a2">mpls enable</font>

**\[Command]**
**mpls enable**

**\[Purpose]**
Enable mpls function

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">filter-list *filter-name* \{seq *number* permit \{*ip-address*|any\}|permit \{*ip-address*|any\}|remark *String*\}</font>

**\[Command]**
**filter-list *filter-name* \{seq *number* permit \{*ip-address*|any}|permit \{*ip-address*|any}|remark *String*}**

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

**\[Parameter]**

| **Parameter**     | **Description**                                                                                                                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| seq number        | Configure the rule ID. If not configured, the default increment for each dispatch is 5. Configuration range: 1 to 4,294,967,295 |
| permit ip-address | Configure MPLS label filtering conditions, supporting IP address filtering in both A.B.C.D/M and A.B.C.D formats.               |
| permit any        | Configure Transparent MPLS Label Filtering Policy                                                                               |
| remark String     | Set description information for the tag policy                                                                                  |

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">ipv6 filter-list *filter-name* \{seq *number* permit \{*ipv6-address*|any\}|permit \{*ipv6-address*|any\}|remark *String*\}</font>

**\[Command]**
**ipv6 filter-list *filter-name* \{seq *number* permit \{*ipv6-address*|any}|permit \{*ipv6-address*|any}|remark *String*}**

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

**\[Parameter]**

| **Parameter**     | **Description**                                                                                                                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| seq number        | Configure the rule ID. If not configured, the default increment for each dispatch is 5. Configuration range: 1 to 4,294,967,295 |
| permit ip-address | Configure MPLS label filtering conditions, supporting IP address filtering in bothX\:X\::X\:X/M and X\:X\::X\:X  formats.       |
| permit any        | Configure Transparent MPLS Label Filtering Policy                                                                               |
| remark String     | Set description information for the tag policy                                                                                  |

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">mpls ldp</font>

**\[Command]**
**mpls ldp**

**\[Purpose]**
Enter MPLS LDP view

**\[View]**
System configuration view

**\[Use Cases]**

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

## <font color="#2166ae">Static MPLS Configuration</font>

### <font color="#1d50a2">ip route *A.B.C.D/M|A.B.C.D* *gw* label *number*</font>

**\[Command]**
**ip route *A.B.C.D/M|A.B.C.D* *gw* label *number***

**\[Purpose]**
Configure IPv4 Route Forwarding with MPLS Labeling

**\[Parameter]**

| **Parameter**      | **Description**                                                |
| ------------------ | -------------------------------------------------------------- |
| A.B.C.D/M\|A.B.C.D | IPv4 address or network segment                                |
| gw                 | Next hop address of the router                                 |
| number             | MPLS label ID to be marked, configuration range: 16 to 1048575 |

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">ipv6 route *A.B.C.D/M|A.B.C.D* *gw* label *number*</font>

**\[Command]**
**ipv6 route *A.B.C.D/M|A.B.C.D* *gw* label *number***

**\[Purpose]**
Configure IPv6 Route Forwarding with MPLS Labeling

**\[Parameter]**

| **Parameter** | **Description**                                                |
| ------------- | -------------------------------------------------------------- |
| X\:X\::X\:X/M | IPv6 network segment                                           |
| gw            | Next hop address of the router                                 |
| number        | MPLS label ID to be marked, configuration range: 16 to 1048575 |

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">mpls lsp *number* *A.B.C.D|X\:X\:\:X*\:X \{number|explicit-null|implicit-null\}</font>

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

**\[Purpose]**
Configure MPLS Static Label Processing Policy

**\[Parameter]**

| **Parameter**        | **Description**                                                                                                                                                         |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| number               | MPLS label ID to be marked, configuration range: 16 to 1048575                                                                                                          |
| A.B.C.D\|X\:X\::X\:X | IPv4 or IPv6 address of the next hop                                                                                                                                    |
| explicit-null        | The 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-null        | Inform 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]**

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

## <font color="#1d50a2">MPLS LDP Configuration</font>

### <font color="#1d50a2">show mpls ldp neighbor</font>

**\[Command]**
**show mpls ldp neighbor**

**\[Purpose]**
View MPLS LDP Neighbor Relationships

**\[View]**
System view

**\[Use Cases]**

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

### <font color="#1d50a2">show mpls ldp binding</font>

**\[Command]**
**show mpls ldp binding**

**\[Purpose]**
View MPLS LDP label information

**\[Parameter]**

| **Parameter** | **Description**                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Local Label   | How locally marked MPLS labels are applied to packets and communicated to neighbors                                                              |
| Remote Label  | Received from the neighbor regarding how to mark MPLS labels on packets                                                                          |
| In Use        | If it being used by the device                                                                                                                   |
| imp-null      | Inform 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]**

```plaintext
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
```

### <font color="#1d50a2">show mpls ldp neighbor detail</font>

**\[Command]**
**show mpls ldp neighbor detail**

**\[Purpose]**
View MPLS LDP Neighbor Negotiation Parameters

**\[View]**
System view

**\[Use Cases]**

```plaintext
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
```

### <font color="#1d50a2">mpls ldp</font>

**\[Command]**
**mpls ldp**

**\[Purpose]**
Enable MPLS LDP on the interface

**\[View]**
Interface configuraton view

**\[Use Cases]**

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

### <font color="#1d50a2">dual-stack cisco-interop</font>

**\[Command]**
**dual-stack cisco-interop**

**\[Purpose]**
Enable MPLS LDP dual-stack neighbor establishment

**\[View]**
MPLS LDP configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">router-id *ip-address*</font>

**\[Command]**
**router-id *ip-address***

**\[Purpose]**
Configure the router-id of MPLS LDP

**\[Parameter]**

| **Parameter** | **Description**                                     |
| ------------- | --------------------------------------------------- |
| ip-address    | Name the router-id in the format of an ipv4 address |

**\[View]**
MPLS LDP configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">dual-stack transport-connection prefer ipv4</font>

**\[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]**

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

### <font color="#1d50a2">discovery hello \{holdtime|interval\} *VALUE*</font>

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

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

**\[Parameter]**

| **Parameter** | **Description**                                    |
| ------------- | -------------------------------------------------- |
| holdtime      | Set the keepalive interval for hello packets       |
| interval      | Set the transmission interval for hello packets    |
| VALUE         | Time (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]**

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

### <font color="#1d50a2">address-family *ipv4|ipv6*</font>

**\[Command]**
**address-family *ipv4|ipv6***

**\[Purpose]**
Enter the ipv4 or ipv6 address-family

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">ordered-control</font>

**\[Command]**
**ordered-control**

**\[Purpose]**
Configure MPLS LDP for Label Ordering Control Mode

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# configure 
sonic(config)# ordered-control
```

### <font color="#1d50a2">neighbor *LDP-ID* \{password *String*|session \{holdtime|interval\} *Time*|ttl-security \{disable|hops *Hops*\}\}</font>

**\[Command]**
**neighbor *LDP-ID* \{password *String*|session \{holdtime|interval} *Time*|ttl-security \{disable|hops *Hops*}}**

**\[Purpose]**
Configure relevant parameters for the specified LDP neighbor

**\[Parameter]**

| **Parameter**          | **Description**                                                                                                                                         |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LDP-ID                 | Specify the router-id of the LDP neighbor                                                                                                               |
| password String        | To establish an LDP neighbor, the keys at both ends must match for successful neighbor establishment                                                    |
| session interval Time  | Set the interval for sending LDP Keepalive messages to specified neighbors. Configuration range: 5 to 65535, unit: seconds. Default: 60 seconds.        |
| session holdtime Time  | Set the LDP Keepalive aging period for specified neighbors. Configuration range: 15 to 65535 seconds. Unit: seconds. Default: 300 seconds.              |
| ttl-security hops Hops | Set the hop count for specifying remote neighbors. If exceeded, the neighbor relationship is terminated. Configuration range: 1-254. Default: disabled. |
| ttl-security disable   | Disable 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]**

```plaintext
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
```

### <font color="#1d50a2">exit-address-family</font>

**\[Command]**
**exit-address-family**

**\[Purpose]**
Exit Address Family Configuration Mode

**\[View]**
MPLS LDP address-family configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">discovery \{hello holdtime|interval\} *Time*</font>

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

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

**\[Parameter]**

| **Parameter** | **Description**                                                                                                  |
| ------------- | ---------------------------------------------------------------------------------------------------------------- |
| holdtime Time | Configure the aging period for LDP Hello messages. Range: 1 to 65535, unit: seconds. Default: 15 seconds.        |
| interval Time | Configure 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]**

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

### d<font color="#1d50a2">iscovery transport-address *ip-address*</font>

**\[Command]**
**discovery transport-address *ip-address***

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

**\[Parameter]**

| **Parameter** | **Description**                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| ip-address    | This parameter is typically configured as the IP address of the interconnect interface. |

**\[View]**
MPLS LDP address-family configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">neighbor *ip-address* targeted</font>

**\[Command]**
**neighbor *ip-address* targeted**

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

**\[Parameter]**

| **Parameter** | **Description**                                                                |
| ------------- | ------------------------------------------------------------------------------ |
| ip-address    | IP 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]**

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

### <font color="#1d50a2">ttl-security disable</font>

**\[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]**

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

### <font color="#1d50a2">session \{holdtime|interval\} *Time*</font>

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

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

**\[Parameter]**

| **Parameter** | **Description**                                                           |
| ------------- | ------------------------------------------------------------------------- |
| holdtime Time | Configuration Range: 15–65535, Unit: seconds, Default Value: 300 seconds  |
| interval Time | Configuration Range: 5 to 65535, Unit: seconds, Default Value: 60 seconds |

**\[View]**
MPLS LDP address-family configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">label local advertise \{to *filter-name*|for *filter-name*|explicit-null|explicit-null for *filter-name*\}</font>

**\[Command]**
**label local advertise \{to *filter-name*|for *filter-name*|explicit-null|explicit-null for *filter-name*}**

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

**\[Parameter]**

| **Parameter**                 | **Description**                                                                     |
| ----------------------------- | ----------------------------------------------------------------------------------- |
| filter-name                   | Name of the MPLS Neighbor Filtering Policy                                          |
| to filter-name                | Only send MPLS label information for neighbors that meet the filtering criteria     |
| for filter-name               | Send only MPLS label information for routes that meet the filtering criteria        |
| explicit-null                 | Enable MPLS label popping at the last-hop device                                    |
| explicit-null for filter-name | MPLS label last-hop pop occurs only on routes that comply with the filtering policy |

**\[View]**
MPLS LDP address-family configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">label local allocate \{host-routes|for *filter-name*\}</font>

**\[Command]**
**label local allocate \{host-routes|for *filter-name*}**

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

**\[Parameter]**

| **Parameter**   | **Description**                                                    |
| --------------- | ------------------------------------------------------------------ |
| host-routes     | Enable MPLS label assignment only for local host routing.          |
| for filter-name | Assign MPLS labels only to routes that match the filtering policy. |

**\[View]**
MPLS LDP address-family configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">label remote accept \{from *filter-name*|for *filter-name*\}</font>

**\[Command]**
**label remote accept \{from *filter-name*|for *filter-name*}**

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

**\[Parameter]**

| **Parameter**     | **Description**                                                                                    |
| ----------------- | -------------------------------------------------------------------------------------------------- |
| from filter-name  | Only receive MPLS label information advertised by neighbors that comply with the filtering policy. |
| for filter-name   | Only accept MPLS label information that conforms to the filtering policy routing.                  |

**\[View]**
MPLS LDP address-family configuration view

**\[Use Cases]**

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

## <font color="#1d50a2">MPLS L2VPN Configuration</font>

### <font color="#1d50a2">show mpls l2vpn</font>

**\[Command]**
**show mpls l2vpn**

**\[Purpose]**
View MPLS L2VPN information

**\[View]**
Syetem view

**\[Use Cases]**

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

### <font color="#1d50a2">show mpls pseudowires</font>

**\[Command]**
**show mpls pseudowires**

**\[Purpose]**
View MPLS PW information

**\[View]**
Syetem view

**\[Use Cases]**

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

### <font color="#1d50a2">show mpls pseudowires detail</font>

**\[Command]**
**show mpls pseudowires detail**

**\[Purpose]**
View detailed output information for MPLS PWs

**\[View]**
Syetem view

**\[Use Cases]**

```plaintext
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
```

### <font color="#1d50a2">pseudowire static *name*</font>

**\[Command]**
**spseudowire static *name***

**\[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]**

```plaintext
sonic# configure 
sonic(config)# pseudowire static pw1
```

### <font color="#1d50a2">mpls label local *number* remote *number*</font>

**\[Command]**
**mpls label local *number* remote *number***

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

**\[Parameter]**

| **Parameter** | **Description**         |
| ------------- | ----------------------- |
| number        | Value range: 16–1048575 |

**\[View]**
PW configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">neighbor \{A.B.C.D|X\:X\:\:X\:X\}</font>

**\[Command]**
**neighbor \{A.B.C.D|X\:X\::X**:&#x58;**}**

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

**\[Parameter]**

| **Parameter** | **Description**                   |
| ------------- | --------------------------------- |
| A.B.C.D       | Remote PW's IPv4 neighbor address |
| X\:X\::X\:X   | Remote PW's IPv6 neighbor address |

**\[View]**
PW configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">pseudowire *name*</font>

**\[Command]**
**npseudowire *name***

**\[Purpose]**
Configure Dynamic PW

**\[Parameter]**

| **Parameter** | **Description**             |
| ------------- | --------------------------- |
| name          | Custom PW Name, String type |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic# configure 
sonic(config)# pseudowire pw
```

### <font color="#1d50a2">pw-id *ID*</font>

**\[Command]**
**pw-id *ID***

**\[Purpose]**
Configure the dynamic PW's pw-id

**\[Parameter]**

| **Parameter** | **Description**                        |
| ------------- | -------------------------------------- |
| ID            | Allowable 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]**

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

### <font color="#1d50a2">neighbor lsr-id *A.B.C.D*</font>

**\[Command]**
**neighbor lsr-id *A.B.C.D***

**\[Purpose]**
Configure dynamic PW lsr-id

**\[Parameter]**

| **Parameter** | **Description**            |
| ------------- | -------------------------- |
| A.B.C.D       | PW Neighbor's IPv4 Address |

**\[View]**
PW configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">pw-status disable</font>

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

**\[Purpose]**
Modify the status of the dynamic password

**\[View]**
PW configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">L2vpn *name* type \{vpls|vpws\}</font>

**\[Command]**
**L2vpn *name* type \{vpls|vpws}**

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

**\[Parameter]**

| **Parameter** | **Description**                                                                                      |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| vpls          | Virtual Private LAN Service (VPLS) is a point-to-multipoint Layer 2 Virtual Private Network (L2VPN). |
| vpws          | Virtual Private Network service is a point-to-point L2VPN.                                           |

**\[View]**
System configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">member pseudowire *name*</font>

**\[Command]**
**member pseudowire *name***

**\[Purpose]**
Add PW members to the existing L2VPN.

**\[Parameter]**

| **Parameter** | **Description**           |
| ------------- | ------------------------- |
| name          | Static or Dynamic PW Name |

**\[View]**
L2VPN configuration view

**\[Use Cases]**

```plaintext
sonic# configure 
sonic(config)# l2vpn VPLS type vpls 
sonic(config-l2vpn)# member pseudowire pw1
```

### <font color="#1d50a2">member interface \{ethernet|vlan|link-aggregation\}</font>

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

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

**\[Parameter]**

| **Parameter**    | **Description**    |
| ---------------- | ------------------ |
| ethernet         | Physical interface |
| vlan             | Vlan interface     |
| link-aggregation | Lag interface      |

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

**\[View]**
L2VPN configuration view

**\[Use Cases]**

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

## <font color="#1d50a2">MPLS L3VPN Configuration</font>

### <font color="#1d50a2">v4|ipv6\} route vrf all</font>

**\[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]**

```plaintext
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
```

### <font color="#1d50a2">address-family \{ipv4|ipv6\} vpn</font>

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

**\[Purpose]**
Enter ipv4/ipv6 MPLS VPN view

**\[View]**
BGP configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">neighbor \{A.B.C.D|X\:X\:\:X\:X\} activate</font>

**\[Command]**
**neighbor \{A.B.C.D|X\:X\::X**:&#x58;**} activate**

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

**\[View]**
MPLS VPN configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">label vpn export \{auto|allocation-mode \{per-vrf|per-nexthop\}|*Label-number*\}</font>

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

**\[Purpose]**
Configure MPLS VPN Label Assignment Method

**\[Parameter]**

| **Parameter**   | **Description**                                                                                                            |
| --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| auto            | Automatically assign MPLS labels to routes                                                                                 |
| allocation-mode | *per-vrf* Routes are assigned labels based on the VRF; routes within the same VRF are assigned the same label.             |
| allocation-mode | *per-nexthop* Assign labels based on the next hop of the route; routes with the same next hop are assigned the same label. |
| Label-number    | Manually set the MPLS label assigned to the route                                                                          |

**\[View]**
BGP configuration view

**\[Use Cases]**

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

### <font color="#1d50a2">mpls bgp l3vpn-multi-domain-switching</font>

**\[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]**

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

### <font color="#1d50a2">rd vpn export \{*as-number*\:*number*|*ip-address*\:*number*\}</font>

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

**\[Purpose]**
Configuring RD Parameters for an MPLS VPN

**\[Parameter]**

| **Parameter**      | **Description**                                           |
| ------------------ | --------------------------------------------------------- |
| as-number\:number  | HQoS configuration file name                              |
| ip-address\:number | RD 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]**

```plaintext
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
```

### <font color="#1d50a2">rt vpn \{import|export|both\} \{A.B.C.D\:MN|EF\:OPQR|GHJK\:MN\}</font>

**\[Command]**
**rt vpn \{import|export|both} \{A.B.C.D**:M&#x4E;**|EF**:OPQ&#x52;**|GHJK**:M&#x4E;**}**

**\[Purpose]**
Configuring the RT Parameters for an MPLS VPN

**\[Parameter]**

| **Parameter** | **Description**                                                                   |
| ------------- | --------------------------------------------------------------------------------- |
| import        | Configure RT parameters for receiving VPN routes                                  |
| export        | Configure RT parameters for sending VPN routes                                    |
| both          | Configure RT parameters for both receiving and sending VPN routes simultaneously. |
| A.B.C.D\:MN   | RT parameter format, for example: 1.1.1.1:22                                      |
| EF\:OPQR      | RT parameter format, for example: 11:2222                                         |
| GHJK\:MN      | RT 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]**

```plaintext
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
```

### <font color="#1d50a2">\{export|import\} vpn</font>

**\[Command]**
**\{export|import} vpn**

**\[Purpose]**
Export/Import VPN Routes

**\[View]**
BGP configuration view

**\[Use Cases]**

```plaintext
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
```

