This post is a collaborative lab effort by LittleWolf and Jamesits. Below, we build a complete carrier-style MPLS L3VPN network purely on open-source Debian Linux and FRRouting (FRR)—no commercial router licenses required.
MPLS operates at Layer 2.5 using fixed-length labels. Historically, software-based IP routers had to execute expensive longest-prefix-match RIB/FIB lookups at every hop, and MPLS accelerated forwarding through compact label-table swaps. While modern hardware ASICs make raw IP forwarding line-rate, MPLS remains foundational because of the services layered over it—most notably BGP/MPLS L3VPN and Traffic Engineering.
Why Build MPLS L3VPN on Debian Linux + FRRouting?
MPLS VPN was designed to solve inherent limitations of legacy VPNs—most importantly overlapping address spaces—ensuring multiple tenants can reuse identical private IP ranges while exchanging traffic securely across a shared provider backbone.
H3C Technical Documentation — L3VPN Fundamentals
Commercial virtual routers such as Cisco IOS-XE or Juniper vMX offer mature MPLS VPN stacks, but production licensing can easily cost thousands of dollars. Using the native Linux kernel MPLS data plane combined with FRRouting (FRR) gives network engineers a faithful, zero-cost lab environment for mastering MP-BGP VPNv4.
Lab Topology & Overlapping Customer Subnets
For instructions on compiling FRR and enabling kernel MPLS modules on Debian, refer to Jamesits’s companion guide: Using Linux as an MPLS Router.
Note that due to Linux’s Persistent Net Device Naming, EVE-NG ports e0, e1, and e2 map to ens3, ens4, and ens5 inside Debian.
1. Configuring the Underlay IGP: IS-IS Level-2
After assigning interface IP addresses at the Linux kernel level, enter vtysh to configure IS-IS Level-2 across the provider core (preferred over OSPF in large service-provider backbones):
#P interface dummy0 ip router isis 1 ! interface ens3 ip router isis 1 isis circuit-type level-2-only ! interface ens4 ip router isis 1 isis circuit-type level-2-only ! interface ens5 ip router isis 1 isis circuit-type level-2-only ! router isis 1 is-type level-2-only net 47.0000.0000.0000.0001.00 #PE1 interface dummy0 ip router isis 1 isis circuit-type level-2-only ! interface ens3 ip router isis 1 isis circuit-type level-2-only ! router isis 1 is-type level-2-only net 47.0000.0000.0000.0002.00 #PE2 interface dummy0 ip router isis 1 isis circuit-type level-2-only ! interface ens3 ip router isis 1 isis circuit-type level-2-only ! router isis 1 is-type level-2-only net 47.0000.0000.0000.0003.00 #RR interface dummy0 ip router isis 1 isis circuit-type level-2-only ! interface ens3 ip router isis 1 isis circuit-type level-2-only ! router isis 1 is-type level-2-only net 47.0000.0000.0000.0004.00
Verify IS-IS adjacencies and loopback reachability on core router P:
localhost# show ip route isis
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, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
I>* 10.0.0.1/32 [115/20] via 192.168.2.1, ens4, 00:05:18
I>* 10.0.0.3/32 [115/20] via 192.168.3.2, ens5, 00:03:04
I>* 10.0.0.4/32 [115/20] via 192.168.1.1, ens3, 00:17:05
I 192.168.1.0/24 [115/20] via 192.168.1.1, ens3 inactive, 00:17:05
I 192.168.2.0/24 [115/20] via 192.168.2.1, ens4 inactive, 00:05:18
I 192.168.3.0/24 [115/20] via 192.168.3.2, ens5 inactive, 00:03:04
localhost# show isis neighbor
Area 1:
System Id Interface L State Holdtime SNPA
localhost ens3 2 Up 29 0050.0100.0800
localhost ens4 2 Up 29 0050.0100.0300
localhost ens5 2 Up 29 0050.0100.0600
2. Enabling Kernel MPLS Input & FRR LDP Signaling
Next, enable MPLS input per core interface via sysctl and configure mpls ldp in FRR across P, PE1, PE2, and RR (10.0.0.4):
#P sysctl net.mpls.conf.ens3.input=1 sysctl net.mpls.conf.ens4.input=1 sysctl net.mpls.conf.ens5.input=1 #vtysh.cli mpls ldp router-id 10.0.0.2 address-family ipv4 discovery transport-address 10.0.0.2 interface ens3 interface ens4 interface ens5 #PE1 sysctl net.mpls.conf.ens3.input=1 #vtysh.cli mpls ldp router-id 10.0.0.1 address-family ipv4 discovery transport-address 10.0.0.1 interface ens3 #PE2 sysctl net.mpls.conf.ens3.input=1 #vtysh.cli mpls ldp router-id 10.0.0.3 address-family ipv4 discovery transport-address 10.0.0.3 interface ens3 #RR (10.0.0.4) sysctl net.mpls.conf.ens3.input=1 #vtysh.cli mpls ldp router-id 10.0.0.4 address-family ipv4 discovery transport-address 10.0.0.4 interface ens3
Confirm that all three LDP sessions are OPERATIONAL on core router P:
localhost# show mpls ldp nei AF ID State Remote Address Uptime ipv4 10.0.0.1 OPERATIONAL 10.0.0.1 00:01:53 ipv4 10.0.0.3 OPERATIONAL 10.0.0.3 00:00:05 ipv4 10.0.0.4 OPERATIONAL 10.0.0.4 00:00:46
3. Configuring the iBGP VPNv4 Route Reflector & PEs
With the core inside AS 65000, deploy an iBGP VPNv4 Route Reflector (RR) architecture. Core router P remains BGP-free, switching strictly on MPLS labels:
#RR #vtysh.cli router bgp 65000 no bgp default ipv4-unicast neighbor 10.0.0.1 remote-as 65000 neighbor 10.0.0.1 update-source dummy0 neighbor 10.0.0.3 remote-as 65000 neighbor 10.0.0.3 update-source dummy0 address-family ipv4 vpn neighbor 10.0.0.1 activate neighbor 10.0.0.1 route-reflector-client neighbor 10.0.0.3 activate neighbor 10.0.0.3 route-reflector-client #PE1 & PE2 #vtysh.cli router bgp 65000 no bgp default ipv4-unicast neighbor 10.0.0.4 remote-as 65000 neighbor 10.0.0.4 update-source dummy0 address-family ipv4 vpn neighbor 10.0.0.4 activate
Because this lab exchanges only customer VPNv4 prefixes, the default ipv4-unicast family is left disabled (though production deployments should configure address families explicitly per standard policy). Verify the VPNv4 sessions on the RR:
#RR #vtysh.cli localhost# show bgp summary IPv4 VPN Summary: BGP router identifier 192.168.1.1, local AS number 65000 vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 2, using 41 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.1 4 65000 4 4 0 0 0 00:01:08 0 10.0.0.3 4 65000 3 3 0 0 0 00:00:37 0 Total number of neighbors 2
4. Creating Linux Kernel VRFs & Configuring FRR Route Leaking
On Debian Linux, VRFs are instantiated as kernel virtual devices bound to separate routing tables (table 100 and table 200). Notice how PE1 assigns the exact same interface subnet 10.10.1.1/24 to both VRF blue and VRF red (and PE2 reuses 10.10.2.1/24 across both)—cleanly demonstrating kernel-level VRF isolation:
#PE1 # linux shell # VRF BLUE ip link add blue type vrf table 100 ip link set blue up ip route add vrf blue unreachable default metric 4278198272 ip link set ens4 vrf blue ip link set ens4 up ip addr add 10.10.1.1/24 dev ens4 # VRF RED ip link add red type vrf table 200 ip link set red up ip route add vrf red unreachable default metric 4278198272 ip link set ens5 vrf red ip link set ens5 up ip addr add 10.10.1.1/24 dev ens5 #PE2 #Linux shell #VRF RED ip link add red type vrf table 200 ip link set red up ip route add vrf red unreachable default metric 4278198272 ip link set ens4 vrf red ip link set ens4 up ip addr add 10.10.2.1/24 dev ens4 #VRF BLUE ip link add blue type vrf table 100 ip link set blue up ip route add vrf blue unreachable default metric 4278198272 ip link set ens5 vrf blue ip link set ens5 up ip addr add 10.10.2.1/24 dev ens5
With the CE routers (Customer-Blue in private AS 65531 and Customer-Red in private AS 65530) already advertising their LAN prefixes, configure PE-CE BGP and VPNv4 import/export inside FRR on PE1 and PE2 (if zebra emits a transient warning while committing, verify the running configuration with show run):
#PE1 #vtysh.cli router bgp 65000 vrf blue neighbor 10.10.1.2 remote-as 65531 bgp router-id 10.10.1.1 ! address-family ipv4 unicast label vpn export auto rd vpn export 65000:100 rt vpn both 65000:100 export vpn import vpn exit-address-family ! router bgp 65000 vrf red neighbor 10.10.1.2 remote-as 65530 bgp router-id 10.10.1.1 ! address-family ipv4 unicast label vpn export auto rd vpn export 65000:200 rt vpn both 65000:200 export vpn import vpn exit-address-family #PE2 #vtysh.cli router bgp 65000 vrf blue bgp router-id 10.10.2.1 neighbor 10.10.2.2 remote-as 65531 ! address-family ipv4 unicast label vpn export auto rd vpn export 65000:100 rt vpn both 65000:100 export vpn import vpn exit-address-family ! router bgp 65000 vrf red bgp router-id 10.10.2.1 neighbor 10.10.2.2 remote-as 65530 ! address-family ipv4 unicast label vpn export auto rd vpn export 65000:200 rt vpn both 65000:200 export vpn import vpn exit-address-family
Check show ip bgp vrf all summary on both PE1 and PE2 to confirm VPNv4 routes are flowing between POPs:
#PE1 localhost# show ip bgp vrf all summary Instance default: IPv4 VPN Summary: BGP router identifier 192.168.2.1, local AS number 65000 vrf-id 0 BGP table version 0 RIB entries 5, using 920 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.4 4 65000 82 80 0 0 0 01:13:17 2 Total number of neighbors 1 Instance blue: IPv4 Unicast Summary: BGP router identifier 10.10.1.1, local AS number 65000 vrf-id 9 BGP table version 2 RIB entries 3, using 552 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.1.2 4 65531 31 26 0 0 0 00:20:18 1 Total number of neighbors 1 Instance red: IPv4 Unicast Summary: BGP router identifier 10.10.1.1, local AS number 65000 vrf-id 10 BGP table version 4 RIB entries 3, using 552 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.1.2 4 65530 37 30 0 0 0 00:18:32 1 Total number of neighbors 1 #PE2 localhost# show ip bgp vrf all su Instance default: IPv4 VPN Summary: BGP router identifier 192.168.3.2, local AS number 65000 vrf-id 0 BGP table version 0 RIB entries 5, using 920 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.0.0.4 4 65000 80 76 0 0 0 01:11:57 2 Total number of neighbors 1 Instance blue: IPv4 Unicast Summary: BGP router identifier 10.10.2.1, local AS number 65000 vrf-id 10 BGP table version 1 RIB entries 1, using 184 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.2.2 4 65531 11 8 0 0 0 00:05:43 1 Total number of neighbors 1 Instance red: IPv4 Unicast Summary: BGP router identifier 10.10.2.1, local AS number 65000 vrf-id 9 BGP table version 2 RIB entries 3, using 552 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.2.2 4 65530 11 9 0 0 0 00:05:43 1 Total number of neighbors 1
5. Solving Missing Remote CE Routes: BGP as-override
Checking ShenZhen-Edge reveals only its local prefix 172.19.1.0/24; the remote Xiamen prefix 172.19.2.0/24 is missing:
#ShenZhen-Edge
Router#show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 172.19.1.0/24 0.0.0.0 0 32768 i
This happens because of BGP’s loop-prevention rule: 172.19.2.0/24 arrives with an AS_PATH of AS 65531 <- AS 65000 <- AS 65531 i, so ShenZhen-Edge drops the update upon seeing its own ASN (65531). There are two standard fixes:
allowas-inon the CE: Relaxes AS_PATH loop detection on the customer router, introducing potential routing-loop risk in dual-homed topologies.as-overrideon the PE: The provider PE replaces the customer’s originating ASN in the AS_PATH with its own provider ASN (65000), preserving loop safety on the CE.
Applying as-override on PE1 and PE2 across both customer VRFs cleanly resolves the issue:
#PE1 #vtysh.cli router bgp 65000 vrf blue ! address-family ipv4 unicast neighbor 10.10.1.2 as-override exit-address-family ! router bgp 65000 vrf red ! address-family ipv4 unicast neighbor 10.10.1.2 as-override exit-address-family #PE2 #vtysh.cli router bgp 65000 vrf blue ! address-family ipv4 unicast neighbor 10.10.2.2 as-override exit-address-family ! router bgp 65000 vrf red ! address-family ipv4 unicast neighbor 10.10.2.2 as-override exit-address-family
Re-checking ShenZhen-Edge confirms that 172.19.2.0/24 is now installed with AS_PATH 65000 65000 i:
#Shenzhen-edge
Router#show ip bgp
BGP table version is 5, local router ID is 172.19.1.1
Network Next Hop Metric LocPrf Weight Path
*> 172.19.1.0/24 0.0.0.0 0 32768 i
*> 172.19.2.0/24 10.10.1.1 0 0 65000 65000 i
6. End-to-End Verification with Overlapping IPs (netcat)
Finally, verify data-plane isolation with nc between Linux9 → Linux12 (VRF Blue) and Linux11 → Linux10 (VRF Red). Both pairs use the exact same destination IP and port (172.19.2.2:8888), yet each stream delivers exclusively to its matching tenant:
# Linux9 (Customer-Blue, ShenZhen) -> Linux12 (Customer-Blue, Xiamen) root@localhost:~# echo "This is VRF BLUE shenzhen" This is VRF BLUE shenzhen root@localhost:~# nc 172.19.2.2 8888 message from VRF BLUE, shenzhen edge # Linux12 (Listening in VRF BLUE) root@localhost:~# echo "This is VRF BLUE xiamen" This is VRF BLUE xiamen root@localhost:~# nc -l -p 8888 message from VRF BLUE, shenzhen edge # Linux11 (Customer-Red, Beijing) -> Linux10 (Customer-Red, Sichuan) root@localhost:~# echo "This is VRF RED beijing" This is VRF RED beijing root@localhost:~# nc 172.19.2.2 8888 message from VRF RED, beijing edge # Linux10 (Listening in VRF RED) root@localhost:~# echo "This is VRF RED sichuan" This is VRF RED sichuan root@localhost:~# nc -l -p 8888 message from VRF RED, beijing edge
Both tenant VRFs carry overlapping 172.19.0.0/16 traffic cleanly across the Debian + FRR MPLS core. Many thanks again to Jamesits for collaborating on this lab.
References
- Using Linux as an MPLS Router — Jamesits
- MPLS & LDP Fundamentals — H3C
- L3VPN Fundamentals — H3C