Each customer needs their own routing table. Their addresses might overlap with other customers. They need to reach their own sites but not others. Managing separate physical infrastructure doesn’t scale.
MPLS L3VPN (Layer 3 VPN) solves this. Each customer gets a Virtual Routing and Forwarding (VRF) instance. Customer routes are distinguished by Route Distinguisher. Route Targets control which VRFs import which routes. The MPLS backbone carries traffic with label stacks identifying VPN and destination.
L3VPN provides scalable multi-tenant connectivity over shared infrastructure.
L3VPN Concepts
Key Components
PE (Provider Edge): Has VRFs, connects to customersP (Provider): Core router, just MPLS forwardingCE (Customer Edge): Customer router, no VPN awareness
[CE1] ─── [PE1] ═══ MPLS ═══ [PE2] ─── [CE2] Site A Backbone Site BVRF (Virtual Routing and Forwarding)
Separate routing table per customer:
VRF CustomerA: 10.0.0.0/8 → Site AVRF CustomerB: 10.0.0.0/8 → Site B (same addresses, different VRF)Global: Provider infrastructure onlyRoute Distinguisher (RD)
Makes routes unique in BGP (not for forwarding):
Without RD: 10.0.0.0/8 from Customer A 10.0.0.0/8 from Customer B ← Collision!
With RD: 65000:1:10.0.0.0/8 from Customer A 65000:2:10.0.0.0/8 from Customer B ← UniqueRoute Target (RT)
Controls route import/export between VRFs:
Export RT: "Tag this route for customers who want it"Import RT: "Import routes with this tag"
CustomerA-VRF exports: 65000:100CustomerA-VRF imports: 65000:100 (import own routes at other sites)Basic L3VPN Configuration
PE Router Setup
configure
# Create VRF for customerset vrf name CUSTOMER-A table 10set vrf name CUSTOMER-A description "Customer A VPN"
# Route Distinguisher (unique per VRF)set vrf name CUSTOMER-A protocols bgp address-family ipv4-unicast rd 65000:1
# Route Targetsset vrf name CUSTOMER-A protocols bgp address-family ipv4-unicast route-target export 65000:100set vrf name CUSTOMER-A protocols bgp address-family ipv4-unicast route-target import 65000:100
# Assign interface to VRFset interfaces ethernet eth1 vrf CUSTOMER-Aset interfaces ethernet eth1 address 192.168.1.1/24
commitEnable VPNv4 Address Family
configure
# BGP configurationset protocols bgp system-as 65000set protocols bgp router-id 10.255.0.1
# VPNv4 address family with PE peersset protocols bgp neighbor 10.255.0.2 remote-as 65000set protocols bgp neighbor 10.255.0.2 update-source loset protocols bgp neighbor 10.255.0.2 address-family ipv4-vpn
commitRedistribute Customer Routes
configure
# In the VRF contextset vrf name CUSTOMER-A protocols bgp system-as 65000set vrf name CUSTOMER-A protocols bgp address-family ipv4-unicast redistribute connected
# Or with static routes from CEset vrf name CUSTOMER-A protocols static route 10.1.0.0/16 next-hop 192.168.1.2
commitPE-CE Routing
Static Routing
configure
# Static routes from CEset vrf name CUSTOMER-A protocols static route 10.1.0.0/16 next-hop 192.168.1.2set vrf name CUSTOMER-A protocols static route 10.2.0.0/16 next-hop 192.168.1.2
commiteBGP PE-CE
configure
# BGP session with CE routerset vrf name CUSTOMER-A protocols bgp neighbor 192.168.1.2 remote-as 65100set vrf name CUSTOMER-A protocols bgp neighbor 192.168.1.2 address-family ipv4-unicast
commitOSPF PE-CE
configure
# OSPF with CEset vrf name CUSTOMER-A protocols ospf interface eth1set vrf name CUSTOMER-A protocols ospf redistribute bgp
commitComplete L3VPN Example
Topology
Customer A Site 1 Provider Backbone Customer A Site 2[CE1] ─── [PE1] ═══════════════════════════════ [PE2] ─── [CE2]10.1.0.0/16 VRF:CUST-A VRF:CUST-A 10.2.0.0/16 RD 65000:1 RD 65000:1 RT 65000:100 RT 65000:100PE1 Configuration
configure
# Loopback for BGPset interfaces loopback lo address 10.255.0.1/32
# VRFset vrf name CUST-A table 10set vrf name CUST-A protocols bgp address-family ipv4-unicast rd 65000:1set vrf name CUST-A protocols bgp address-family ipv4-unicast route-target export 65000:100set vrf name CUST-A protocols bgp address-family ipv4-unicast route-target import 65000:100
# Customer interfaceset interfaces ethernet eth1 vrf CUST-Aset interfaces ethernet eth1 address 192.168.1.1/24
# Core interfaceset interfaces ethernet eth0 address 10.0.0.1/30
# MPLS LDPset protocols mpls ldp router-id 10.255.0.1set protocols mpls ldp interface eth0
# OSPF for backboneset protocols ospf area 0 network 10.255.0.1/32set protocols ospf area 0 network 10.0.0.0/30
# BGPset protocols bgp system-as 65000set protocols bgp router-id 10.255.0.1set protocols bgp neighbor 10.255.0.2 remote-as 65000set protocols bgp neighbor 10.255.0.2 update-source loset protocols bgp neighbor 10.255.0.2 address-family ipv4-vpn
# VRF BGPset vrf name CUST-A protocols bgp system-as 65000set vrf name CUST-A protocols bgp neighbor 192.168.1.2 remote-as 65100set vrf name CUST-A protocols bgp neighbor 192.168.1.2 address-family ipv4-unicast
commitPE2 Configuration
configure
# Loopbackset interfaces loopback lo address 10.255.0.2/32
# VRF (same RT for same customer)set vrf name CUST-A table 10set vrf name CUST-A protocols bgp address-family ipv4-unicast rd 65000:1set vrf name CUST-A protocols bgp address-family ipv4-unicast route-target export 65000:100set vrf name CUST-A protocols bgp address-family ipv4-unicast route-target import 65000:100
# Customer interfaceset interfaces ethernet eth1 vrf CUST-Aset interfaces ethernet eth1 address 192.168.2.1/24
# Core interfaceset interfaces ethernet eth0 address 10.0.0.2/30
# MPLS LDPset protocols mpls ldp router-id 10.255.0.2set protocols mpls ldp interface eth0
# OSPFset protocols ospf area 0 network 10.255.0.2/32set protocols ospf area 0 network 10.0.0.0/30
# BGPset protocols bgp system-as 65000set protocols bgp router-id 10.255.0.2set protocols bgp neighbor 10.255.0.1 remote-as 65000set protocols bgp neighbor 10.255.0.1 update-source loset protocols bgp neighbor 10.255.0.1 address-family ipv4-vpn
# VRF BGPset vrf name CUST-A protocols bgp system-as 65000set vrf name CUST-A protocols bgp neighbor 192.168.2.2 remote-as 65100set vrf name CUST-A protocols bgp neighbor 192.168.2.2 address-family ipv4-unicast
commitViewing L3VPN State
Show VPN Routes
# Show VPNv4 routesshow bgp ipv4 vpn
# Output:# Route Distinguisher: 65000:1# *> 10.1.0.0/16 192.168.1.2 0 0 65100 i# *> 10.2.0.0/16 10.255.0.2 0 0 65100 i
# Show specific VRF routesshow ip route vrf CUST-AShow Labels
# Show VPN labelsshow bgp ipv4 vpn labels
# Show MPLS forwarding tableshow mpls tableVerify Connectivity
# Ping within VRFping 10.2.0.1 vrf CUST-A
# Traceroute within VRFtraceroute 10.2.0.1 vrf CUST-ARoute Target Patterns
Hub-and-Spoke
# Hub imports all, spokes import only from hub# Hub VRF:set vrf name HUB protocols bgp address-family ipv4-unicast route-target export 65000:1set vrf name HUB protocols bgp address-family ipv4-unicast route-target import 65000:2
# Spoke VRF:set vrf name SPOKE1 protocols bgp address-family ipv4-unicast route-target export 65000:2set vrf name SPOKE1 protocols bgp address-family ipv4-unicast route-target import 65000:1
# Traffic: Spoke → Hub → Spoke (forced through hub)Full Mesh
# All sites import from all sitesset vrf name SITE protocols bgp address-family ipv4-unicast route-target export 65000:100set vrf name SITE protocols bgp address-family ipv4-unicast route-target import 65000:100
# Any-to-any connectivityExtranet
# Customer A can reach shared services# Customer A VRF:set vrf name CUST-A protocols bgp address-family ipv4-unicast route-target import 65000:999 # Shared services RT
# Shared Services VRF:set vrf name SHARED protocols bgp address-family ipv4-unicast route-target export 65000:999Troubleshooting L3VPN
Routes Not Exchanged
# Check VPNv4 sessionshow bgp ipv4 vpn summary
# Check RT configurationshow vrf CUST-A
# Verify import/export RT match between sitesMPLS Labels Not Working
# Check MPLS is enabled on core interfacesshow interfaces ethernet eth0
# Check LDP neighborshow mpls ldp neighbor
# Check MPLS tableshow mpls tableTraffic Not Flowing
# Verify VRF routing tableshow ip route vrf CUST-A
# Check label stackshow bgp ipv4 vpn 10.2.0.0/16
# Trace pathtraceroute 10.2.0.1 vrf CUST-AThe Lesson
L3VPN provides scalable multi-tenant connectivity over shared infrastructure.
Without L3VPN:
- Separate physical networks per customer
- Address overlap impossible
- Doesn’t scale
With L3VPN:
- Single MPLS backbone serves all customers
- VRFs provide isolation
- Overlapping addresses supported (different RDs)
- Route Targets control connectivity
Key concepts:
- VRF: Separate routing table per customer
- RD: Makes routes globally unique
- RT: Controls import/export between VRFs
- VPNv4: BGP carrying VPN routes with labels
VyOS L3VPN support requires MPLS. Verify feature support in your version before production deployment.