Overview
MPLS L3VPN (RFC 4364) is the backbone technology for most service provider WAN offerings and many large enterprise networks. It combines MPLS label switching for efficient forwarding with MP-BGP VPNv4 for per-customer route separation, allowing thousands of customers with overlapping IP spaces to share the same physical infrastructure without any traffic leakage. Understanding the label stack, VRF design, and VPNv4 BGP is essential for anyone responsible for carrier-grade infrastructure.
Part 1 โ MPLS L3VPN Architecture
1.1 โ The Three Router Roles
- CE (Customer Edge) โ the customer's router. Has no knowledge of MPLS. Runs a standard routing protocol (BGP, OSPF, EIGRP, or static) toward the PE. The CE sees only its own VPN routes.
- PE (Provider Edge) โ the most complex role. Maintains per-customer VRF instances, runs PE-CE routing, redistributes customer routes into VPNv4 BGP, and imposes/disposes the MPLS label stack.
- P (Provider Core) โ pure label-switching routers. They see only transport labels, never VPN labels or customer IP addresses. P routers run IGP (IS-IS or OSPF) and LDP/RSVP for label distribution.
1.2 โ The Label Stack
Every MPLS L3VPN packet carries two labels when traversing the core:
- Top label (transport label) โ assigned by LDP/RSVP, used by P routers to switch the packet hop-by-hop toward the egress PE. This label is swapped at every P router.
- Bottom label (VPN label) โ assigned by the egress PE, identifies which VRF to deliver the packet into upon arrival. P routers never look at this label.
At the penultimate hop (the P router directly connected to the egress PE), the transport label is popped (PHP โ Penultimate Hop Popping), leaving only the VPN label. The egress PE uses the VPN label to identify the VRF and forwards into the correct customer routing table.
Part 2 โ PE Configuration
Step 1 โ Enable MPLS in the Core
# Enable CEF (required for MPLS)
PE1(config)# ip cef
# Enable MPLS on core-facing interfaces
PE1(config)# interface GigabitEthernet0/1
PE1(config-if)# mpls ip
PE1(config-if)# no shutdown
# Verify LDP neighbors and label bindings
PE1# show mpls ldp neighbor
PE1# show mpls ldp bindings
PE1# show mpls forwarding-table
Step 2 โ VRF and Route Distinguisher
# Define VRF with RD and route targets
PE1(config)# vrf definition CUST-ACME
PE1(config-vrf)# rd 65001:100
PE1(config-vrf)# address-family ipv4
PE1(config-vrf-af)# route-target export 65001:100
PE1(config-vrf-af)# route-target import 65001:100
# Bind CE-facing interface to VRF
PE1(config)# interface GigabitEthernet0/0
PE1(config-if)# vrf forwarding CUST-ACME
PE1(config-if)# ip address 10.1.0.1 255.255.255.252
Step 3 โ VPNv4 BGP Between PEs
PE1(config)# router bgp 65001
PE1(config-router)# bgp router-id 1.1.1.1
PE1(config-router)# no bgp default ipv4-unicast
# iBGP session to PE2 (via Route Reflector in large networks)
PE1(config-router)# neighbor 2.2.2.2 remote-as 65001
PE1(config-router)# neighbor 2.2.2.2 update-source Loopback0
# Enable VPNv4 address family
PE1(config-router)# address-family vpnv4
PE1(config-router-af)# neighbor 2.2.2.2 activate
PE1(config-router-af)# neighbor 2.2.2.2 send-community extended
# PE-CE BGP (customer routing)
PE1(config-router)# address-family ipv4 vrf CUST-ACME
PE1(config-router-af)# neighbor 10.1.0.2 remote-as 65100
PE1(config-router-af)# neighbor 10.1.0.2 activate
PE1(config-router-af)# neighbor 10.1.0.2 as-override
# as-override replaces CE AS in BGP path โ needed when all CE sites use same AS
Part 3 โ PE-CE Routing Protocol Options
Part 4 โ Troubleshooting MPLS L3VPN
Step 1 โ Verify the Control Plane
# Check VPNv4 BGP session status
PE1# show bgp vpnv4 unicast all summary
# Check VPNv4 routes for a specific VRF
PE1# show bgp vpnv4 unicast vrf CUST-ACME
PE1# show bgp vpnv4 unicast vrf CUST-ACME 192.168.2.0
# Verify route targets are correct โ missing RT = routes not imported
PE1# show bgp vpnv4 unicast all 192.168.2.0/24 | include RT
# Check VRF routing table
PE1# show ip route vrf CUST-ACME
PE1# show ip route vrf CUST-ACME 192.168.2.0
Step 2 โ Verify the Data Plane
# Check MPLS forwarding table (transport labels)
PE1# show mpls forwarding-table
PE1# show mpls forwarding-table vrf CUST-ACME
# Check CEF for VRF (must have a valid next-hop with label)
PE1# show ip cef vrf CUST-ACME 192.168.2.0 detail
# Trace the MPLS path โ shows label stack at each hop
PE1# traceroute mpls ipv4 192.168.2.0/24 source 1.1.1.1
PE1# ping vrf CUST-ACME 192.168.2.1 source 192.168.1.1
Step 3 โ Common Issues
# Route in VPNv4 table but not in VRF routing table?
# โ Route target import mismatch
PE1# show vrf detail CUST-ACME | include import|export
# VPNv4 BGP session down?
# โ Check loopback reachability and IGP
PE1# ping 2.2.2.2 source Loopback0
PE1# show ip route 2.2.2.2
# Traffic drops in core โ check label switching
P1# show mpls forwarding-table
P1# show mpls ldp bindings 2.2.2.2 32 detail
MPLS L3VPN Hardening Checklist
- All PE loopbacks are reachable via IGP before MPLS is configured
- LDP Router-ID is set to a stable loopback (
mpls ldp router-id Loopback0 force) - VPNv4 BGP uses loopback as update-source โ never a physical interface
- Route Reflectors are used in large networks โ never full-mesh iBGP beyond 5 PEs
- Route targets follow a documented scheme:
ASN:customer-id send-community extendedis configured on all VPNv4 BGP neighbors- PHP (penultimate hop popping) is verified โ egress PE should receive only VPN label
as-overrideorallowas-inis explicitly documented per customer where used- CEF is verified on all PE and P routers โ MPLS requires CEF