L2VPN – LDP based L2VPN
1. Intro
LDP based L2VPN, often referred as Martini L2VPN, is used for connectivity of customer attachment circuits across the provider MPLS network. A L2VPN is a point-to-point connection between two PE routers. This type of VPN emulates transparent L2 services for the customers.
Normally the L2 attachment circuits on each end are the same but may also be different. For example, it is possible to have a tagged interface on one end and an untagged interface on the other end of the VPN.
LDP based L2VPNs use LDP for signaling the tunnel. Extended/targeted LDP sessions are exchanging the control information. A Virtual Circuit Label is distributed between PEs, which identifies the specific L2VPN.
LDP L2VPNs are not configured under routing instances. For each L2 connection a L2circuit must be configured including all required parameters. The Local and remote sites are configured manually, no auto-discovery is supported.
2. Minimal configuration
The minimal LDP based L2VPN configuration is the following:
### Prerequisites:
### - the MPLS core must be configured: LDP, RSVP or SR.
### - LDP must be enabled for Lo0:
set protocols ldp interface lo0.0
### Configure the interface using encapsulation vlan-ccc:
set interfaces ge-0/0/4 vlan-tagging
set interfaces ge-0/0/4 encapsulation flexible-ethernet-services
set interfaces ge-0/0/4 unit 501 description L2C1
set interfaces ge-0/0/4 unit 501 encapsulation vlan-ccc
set interfaces ge-0/0/4 unit 501 vlan-id 501
### Then, only one line to configure the L2Circuit:
set protocols l2circuit neighbor 17.0.0.7 interface ge-0/0/4.501 virtual-circuit-id 1234501
### If the peer was also configured, then we circuit will be UP:
root@R1# run show l2circuit connections brief
Layer-2 Circuit Connections:
Legend for connection status (St)
EI -- encapsulation invalid NP -- interface h/w not present
MM -- mtu mismatch Dn -- down
EM -- encapsulation mismatch VC-Dn -- Virtual circuit Down
CM -- control-word mismatch Up -- operational
VM -- vlan id mismatch CF -- Call admission control failure
OL -- no outgoing label IB -- TDM incompatible bitrate
NC -- intf encaps not CCC/TCC TM -- TDM misconfiguration
BK -- Backup Connection ST -- Standby Connection
CB -- rcvd cell-bundle size bad SP -- Static Pseudowire
LD -- local site signaled down RS -- remote site standby
RD -- remote site signaled down HS -- Hot-standby Connection
XX -- unknown
Legend for interface status
Up -- operational
Dn -- down
Neighbor: 17.0.0.7
Interface Type St Time last up # Up trans
ge-0/0/4.501(vc 1234501) rmt Up Sep 28 06:59:17 2026 1
### The extensive view:
root@R1# run show l2circuit connections extensive
Layer-2 Circuit Connections:
[..]
Neighbor: 17.0.0.7
Interface Type St Time last up # Up trans
ge-0/0/4.501(vc 1234501) rmt Up Sep 28 06:59:17 2026 1
Remote PE: 17.0.0.7, Negotiated control-word: Yes (Null)
Incoming label: 58, Outgoing label: 41
Negotiated PW status TLV: No
Local interface: ge-0/0/4.501, Status: Up, Encapsulation: VLAN
Flow Label Transmit: No, Flow Label Receive: No
Connection History:
Sep 28 06:59:17 2026 status update timer
Sep 28 06:59:17 2026 PE route changed
Sep 28 06:59:17 2026 Out lbl Update 41
Sep 28 06:59:17 2026 In lbl Update 58
Sep 28 06:59:17 2026 loc intf up ge-0/0/4.501
We can also see Wireshark captures. LDP message exchange for Martini L2Circuit setup:
### LDP packet:
> Frame 38: Packet, 120 bytes on wire (960 bits), 120 bytes captured (960 bits)
> Ethernet II, Src: 56:04:0d:00:28:1e (56:04:0d:00:28:1e), Dst: 56:04:0d:00:7a:14 (56:04:0d:00:7a:14)
> Internet Protocol Version 4, Src: 17.0.0.1, Dst: 17.0.0.7
> Transmission Control Protocol, Src Port: 646, Dst Port: 52324, Seq: 19, Ack: 19, Len: 54
> Label Distribution Protocol
Version: 1
PDU Length: 50
LSR ID: 17.0.0.1
Label Space ID: 0
> Label Mapping Message
0... .... = U bit: Unknown bit not set
Message Type: Label Mapping Message (0x400)
Message Length: 40
Message ID: 0x00000690
> FEC
00.. .... = TLV Unknown bits: Known TLV, do not Forward (0x0)
TLV Type: FEC (0x100)
TLV Length: 24
> FEC Elements
> FEC Element 1
FEC Element Type: PWid FEC Element (128)
1... .... = C-bit: Control Word Present
.000 0000 0000 0100 = PW Type: Ethernet Tagged Mode (0x0004)
PW Info Length: 16
Group ID: 0
PW ID: 1234501
> Interface Parameter: MTU 1500
ID: Interface MTU (0x01)
Length: 4
MTU: 1500
> Interface Parameter: VLAN Id 501
ID: Requested VLAN ID (0x06)
Length: 4
VLAN Id: 501
> Interface Parameter: VCCV
ID: VCCV (0x0c)
Length: 4
> CC Type
.... ...1 = PWE3 Control Word: True
.... ..1. = MPLS Router Alert: True
.... .1.. = MPLS Inner Label TTL = 1: True
> CV Type
.... ...0 = ICMP Ping: False
.... ..1. = LSP Ping: True
.... .1.. = BFD IP/UDP-encapsulated, for PW Fault Detection only: True
> Generic Label
00.. .... = TLV Unknown bits: Known TLV, do not Forward (0x0)
TLV Type: Generic Label (0x200)
TLV Length: 4
.... .... .... 0000 0000 0000 0011 1010 = Generic Label: 58 (0x0003a)
And an encapsulated ping going from PE1 to PE2:
### Notice how the L2 Ethernet header is encapsulated with MPLS labels.
### 1st label is for transport (SR), and 2nd label is for our L2Cirucuit.
> Frame 174: Packet, 128 bytes on wire (1024 bits), 128 bytes captured (1024 bits)
> Ethernet II, Src: 56:04:0d:00:28:1e (56:04:0d:00:28:1e), Dst: 56:04:0d:00:7a:14 (56:04:0d:00:7a:14)
> MultiProtocol Label Switching Header, Label: 801007, Exp: 0, S: 0, TTL: 255
1100 0011 1000 1110 1111 .... .... .... = MPLS Label: 801007 (0xc38ef)
.... .... .... .... .... 000. .... .... = MPLS Experimental Bits: 0
.... .... .... .... .... ...0 .... .... = MPLS Bottom Of Label Stack: 0
.... .... .... .... .... .... 1111 1111 = MPLS TTL: 255
> MultiProtocol Label Switching Header, Label: 41, Exp: 0, S: 1, TTL: 255
0000 0000 0000 0010 1001 .... .... .... = MPLS Label: 41 (0x00029)
.... .... .... .... .... 000. .... .... = MPLS Experimental Bits: 0
.... .... .... .... .... ...1 .... .... = MPLS Bottom Of Label Stack: 1
.... .... .... .... .... .... 1111 1111 = MPLS TTL: 255
> PW Ethernet Control Word
Sequence Number: 0
> Ethernet II, Src: 56:04:0d:00:54:71 (56:04:0d:00:54:71), Dst: 56:04:0d:00:56:93 (56:04:0d:00:56:93)
> Destination: 56:04:0d:00:56:93 (56:04:0d:00:56:93)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
> Source: 56:04:0d:00:54:71 (56:04:0d:00:54:71)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: 802.1Q Virtual LAN (0x8100)
[Stream index: 6]
> 802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 501
000. .... .... .... = Priority: Best Effort (default) (0)
...0 .... .... .... = DEI: Ineligible
.... 0001 1111 0101 = ID: 501
Type: IPv4 (0x0800)
> Internet Protocol Version 4, Src: 10.50.1.1, Dst: 10.50.1.7
> Internet Control Message Protocol
3. L2Circuit requirements
For a VPWS/L2Circuit pseudowire, the exact checks vary slightly by vendor, but these are the parameters that generally must match between the two PEs for the PW to come up:
- VC ID
- VC Type – Typically ethernet (0x0005) or ethernet-vlan (0x0004)
- Control Word – usually disabled
- MTU
- PW Status
set protocols l2circuit neighbor 17.0.0.7 interface ge-0/0/4.501 encapsulation-type ethernet
set protocols l2circuit neighbor 17.0.0.7 interface ge-0/0/4.501 no-control-word
In case you are troubleshooting a L2Circuit, we can extend the list with the following:
- Targeted LDP session must be in place (LDP activated on Lo0)
- MPLS transport labels must be configured correctly (LDP, RSVP, SR)