From point A to point B
Point A: Customer A's L3VPN works end to end. But if it stops working tomorrow, where do you start? Point B: by the end of this chapter you'll have a clear verification path, layer by layer, you'll understand why OSPF sometimes arrives as O IA and sometimes as O E2, and you'll have broken and repaired the VPN by changing a single value: the route target.
- A layer-by-layer method: IGP, LDP, BGP VPNv4, VRF and PE-CE
- The verification commands for the core and for BGP VPNv4
- O IA versus O E2 depending on the OSPF process
- Troubleshooting the route target with 999:999
- A symptom table to keep at hand
A layer-by-layer method
An L3VPN is five stacked layers. Each one depends on the one below. If the IGP doesn't reach the other PE's loopback, LDP has no path; if LDP fails, there's no transport label; without BGP VPNv4 there are no prefixes; without the right route target the VRF imports nothing; and without redistribution the CE never finds out.
Five layers, each with its commands and its typical failures. Diagram: The House of Routing.
The method we suggest:
- Define the symptom precisely. Which source, which destination, what fails: is the route missing or is the reply missing? Test from the CE with
sourceset to the loopback. - Confirm the core IGP. Each PE must see the other's loopback (4.4.4.4 and 1.1.1.1).
- Confirm LDP. Neighbors up and an outgoing label toward the remote PE's loopback at every hop.
- Confirm BGP VPNv4. The session between the PEs established and the prefixes received.
- Confirm the VRF and the route target. The RT one side exports is the one the other side imports.
- Confirm the PE-CE. The VRF's OSPF adjacency and redistribution in both directions.
- Change one thing, verify and document. Two changes at once hide the cause.
Layers 1 and 2: IGP and LDP
The P routers have no VRFs and no BGP. What you check there is the label machinery:
! Layers 1 and 2: IGP and LDP, on any P or PE
P1# show mpls interfaces
P1# show mpls label range
P1# show mpls ip binding
P1# show mpls ldp discovery
P1# show mpls ldp neighbor
P1# show mpls ldp bindings
P1# show mpls forwarding-table
show mpls interfaces: which interfaces have MPLS enabled and whether LDP runs on them.show mpls label range: the dynamic label range. In our lab each router has its own hundred (100-199 on PE-1, 200-299 on P1, 300-399 on P2, 400-499 on PE-2), which makes a traceroute instantly readable.show mpls ip binding: the LIB in summary form, with local and remote labels per prefix.show mpls ldp discoveryandshow mpls ldp neighbor: whether hellos are seen and whether the LDP session is up.show mpls forwarding-table: the LFIB, what the router really does with each label (swap, pop or no label).
Layer 3: BGP VPNv4
show bgp ipv4 unicast and show ip bgp are equivalent: one uses the address-family syntax and the other the traditional one. On an L3VPN PE both are empty, and that's fine. Customer routes aren't traditional BGP routes: they live in the VPNv4 address family.
! Layer 3: MP-BGP VPNv4, on the PEs
PE-1# show bgp ipv4 unicast
PE-1# show ip bgp
! both empty: the VPN does not live in the IPv4 unicast table
PE-1# show bgp vpnv4 unicast all summary
PE-1# show bgp vpnv4 unicast vrf TU-CA1
PE-1# show bgp vpnv4 unicast vrf TU-CA1 40.40.40.40/32
On PE-1, show bgp vpnv4 unicast vrf TU-CA1 shows the VRF's table: CE-A1's local routes and 40.40.40.40/32, with next hop 4.4.4.4. Why can you reach a next hop that is another router's loopback? Because the IGP and LDP already built the path to 4.4.4.4, and PE-2 is the one that does the final pop of the VPN label.
The details of 40.40.40.40/32 are your best diagnostic tool:
- It appears under the local RD (300:300), imported from 400:400, the other PE's RD.
- It carries the metric (the inherited OSPF cost) and origin incomplete, the mark of a redistributed route.
- It carries the route target as an extended community. That's what lets the route into the VRF.
O IA or O E2: the OSPF domain
Look at CE-A2's routing table and you'll see the other site's routes as O IA, inter-area. Not as externals. It's a feature of OSPF over MPLS: both customer sites are in area 0, joined by a “super backbone” that is the MPLS network.
The explanation lies in the extended attributes from the previous chapter. The OSPF process travels with each VPNv4 prefix as a domain ID. When the egress PE receives the route:
- If the domain ID matches its own (in the lab,
router ospf 20on both PEs), it advertises the route to the CE as a type 3 LSA: the CE sees O IA. - If it doesn't match (process 20 on one PE and 30 on the other), it advertises it as a type 5 LSA: the CE sees O E2.
Same domain, inter-area route; different domain, external route. Diagram: The House of Routing.
In IOS, if you configure nothing, the domain ID is derived from the process number, as we saw in the BGP output. If your PEs need different processes, the domain-id subcommand of the VRF's OSPF process lets you set the same value on both. RFC 4577 describes this rule, and it's a good test for your lab.
Troubleshooting the route target
Now we break the VPN on purpose. First, confirm the baseline from CE-A2:
! Layers 4 and 5: VRF, route target and PE-CE
PE-1# show run | section vrf
PE-1# show ip vrf
PE-1# show ip route vrf TU-CA1
PE-1# ping vrf TU-CA1 30.30.30.30
PE-1# traceroute vrf TU-CA1 40.40.40.40
CE-A2# show ip route
CE-A2# ping 30.30.30.30 source 41.41.41.41
CE-A2# traceroute 31.31.31.31 source 40.40.40.40 ttl 1 6
The traceroute again shows the fixed Layer 3 VPN label and the transport label, which gets swapped until penultimate hop popping. All good. Now, on PE-2, we remove route target 3:3 and set another one:
PE-2# configure terminal
PE-2(config)# ip vrf TU-CA2
PE-2(config-vrf)# no route-target both 3:3
PE-2(config-vrf)# route-target both 999:999
PE-2(config-vrf)# do show run | section vrf
PE-2(config-vrf)# do show bgp vpnv4 unicast vrf TU-CA2
The RD is still there, unchanged. But in show bgp vpnv4 unicast vrf TU-CA2 the other site's routes disappear: the VRF no longer imports anything tagged 3:3. The same happens on the other side, because PE-2 now exports with 999:999 and PE-1 only imports 3:3.
One confusing detail: for a while, CE-A1 still shows 40.40.40.40 in its table. The route is there, but the ping fails. The table lies to you until BGP and OSPF converge. In class we sped it up with clear ip ospf process on the CE and a BGP clear on the PE. In production, prefer soft resets.
To restore the service without touching PE-2, we add the second route target to VRF TU-CA1:
PE-1# configure terminal
PE-1(config)# ip vrf TU-CA1
PE-1(config-vrf)# route-target both 999:999
PE-1(config-vrf)# do write
PE-1(config-vrf)# do show run | section vrf
ip vrf TU-CA1
rd 300:300
route-target export 3:3
route-target import 3:3
route-target export 999:999
route-target import 999:999
VRF TU-CA1 now has two route targets. It exports its routes with 3:3 and with 999:999, and imports those arriving with either one. CE-A2 sees the routes again and the ping from 30.30.30.30 to 40.40.40.40 answers once more.
CE-A1# clear ip ospf process
CE-A1# show ip route
CE-A1# ping 40.40.40.40 source 30.30.30.30
route-target both is the shortcut for the two commands:
ip vrf TU-CA1
! tag my routes with 999:999 when they leave the VRF
route-target export 999:999
! accept routes that carry 999:999
route-target import 999:999
! both at once: the usual choice
route-target both 999:999
Traffic is bidirectional, so both is the norm: if you export and the other side doesn't import, or the other way round, either the forward or the return path is lost. In class we called it “a marriage”. There are cases for using only one, such as receiving prefixes you return through another path (a backdoor), but the standard doesn't force anything: it's flexibility.
The route target, the key to the service
This exercise leaves the most important idea of the day: the route target is the key to the L3VPN. Not the route distinguisher. The RD only makes routes unique; the RT decides what goes down into each VRF and what comes up out of it.
The RT is service-oriented, not route-oriented. The question it answers is: “what I have here, who do I give it to?” And a VRF can have several:
- An RT for a cloud computing segment, for example 1000:1000, which you enable on any VRF that should reach the cloud.
- Another for backup, another for telephony, another for internet.
- A convention of your own, such as your AS number followed by the customer (100:101, 100:102…), so the network reads itself.
RFC 4364 describes the topologies you get by combining RTs:
| Design | How it's done with RTs |
|---|---|
| Full mesh | Every site exports and imports the same RT (our 3:3) |
| Hub and spoke | Two RTs: the hub exports its own and imports the spokes' RT; the spokes do the opposite. Spokes don't see each other |
| Extranet | Sites from different organizations share an extra RT, like 999:999 in the exercise |
| Shared services | One RT per service (cloud, backup, telephony) that each VRF imports according to what it bought |
The route only goes through when the RT one side exports matches the one the other side imports. Diagram: The House of Routing.
Everything before (OSPF and LDP in the core, iBGP between the PEs, the VPNv4 address family, send-community, the VRF) is the structure. The RT is what opens the door. No VLANs, no trunking, no QinQ, no GRE tunnels. And since the VPN carries prefixes, each site can use its own protocol: OSPF, IS-IS, EIGRP, eBGP or static routes.
Symptom, command and likely cause
| Symptom | Command | Likely cause |
|---|---|---|
| No LDP neighbor on a core link | show mpls interfaces, show mpls ldp discovery | mpls ip missing on the interface, or the LDP loopback is not reachable through the IGP |
| The remote PE's loopback has no outgoing label | show mpls forwarding-table | LDP down on one segment: the transport LSP is broken |
show ip bgp is empty on the PE | show bgp vpnv4 unicast all | Nothing: VPN routes live in VPNv4 |
| No VPNv4 prefixes from the other PE | show bgp vpnv4 unicast all summary | iBGP session down, or neighbor without activate in VPNv4 |
| The prefix arrives without a route target | show bgp vpnv4 unicast vrf with the prefix | send-community both or extended missing |
| The prefix is in BGP but not in the VRF | show run | section vrf | The import RT doesn't match the other side's export RT |
| The VRF has the route, the CE doesn't | show ip route on the CE, show run | section ospf | redistribute bgp 100 subnets missing in the VRF's OSPF |
| The CE sees O E2 where you expected O IA | show ip route on the CE | Different OSPF processes or domain IDs on the PEs |
| The CE shows the route but the ping fails | ping with source, show bgp vpnv4 unicast vrf | Stale route waiting for convergence after a change |
| A ping from a P router to the customer network fails | show ip route on the P | Nothing: P routers don't know customer routes |
Class videos
This chapter goes with the seventh and last part of the first marathon. It is a live session recorded with Cisco routers in GNS3, with audio in Spanish and subtitles in Spanish, English, French and Portuguese.
Recorded live; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 1 playlist on YouTube
Test what you learned
1. You change PE-2's route distinguisher to 500:500 and keep route target 3:3. Does the VPN break?
Answer. No. The RD only makes prefixes unique; what decides the import is the route target, and it still matches.
2. CE-A2 receives the other site's routes as O E2. What do you check first?
Answer. The VRF's OSPF process number on both PEs (or the configured domain ID). If they don't match, the routes are advertised as type 5 LSAs.
3. PE-2 switches to route-target both 999:999. What minimal change on PE-1 restores the service without removing 3:3?
Answer. Add route-target both 999:999 to VRF TU-CA1. It then exports and imports with both values and matches PE-2 again.
4. The VPNv4 prefix reaches PE-1, but with no extended community. What's missing?
Answer. Sending communities to the VPNv4 neighbor: neighbor 1.1.1.1 send-community both (or extended) on PE-2.
5. You want three branches to reach the data center but not each other. How do you use route targets?
Answer. Hub and spoke with two RTs: the hub exports the hub RT and imports the spoke RT; each spoke exports the spoke RT and imports only the hub RT.
Key takeaways
- Verify by layers: IGP, LDP, BGP VPNv4, VRF and route target, PE-CE. Each layer depends on the one below.
- On the P routers you check the label machinery: MPLS interfaces, LDP neighbors, bindings and the LFIB.
- On the PE, VPN routes show up with
show bgp vpnv4 unicast vrf, not withshow ip bgp. - Same OSPF domain, O IA; different domain, O E2.
- The route target, not the RD, is the key: it decides what goes into and out of each VRF.
- A VRF can have several RTs, and with them you build full mesh, hub and spoke, extranets and shared services.
- After a change, the table may show stale routes until everything converges: always validate with ping.
Official resources
- Configure a Basic MPLS VPN Network (Cisco)cisco.com
- MPLS: Layer 3 VPNs Configuration Guide · Multiprotocol BGP MPLS VPN (Cisco)cisco.com
- MPLS VPN OSPF PE and CE Support (Cisco)cisco.com
- OSPF as PE-CE Protocol and Loop-Prevention Techniques in MPLS L3 VPN (Cisco)cisco.com
- RFC 4364 · BGP/MPLS IP Virtual Private Networksrfc-editor.org
- RFC 4577 · OSPF as the PE/CE Protocol for BGP/MPLS IP VPNsrfc-editor.org
Source and credits. Chapter written from the MPLS Masterclass that Jesús Espinoza recorded live in March 2021. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical data and configuration were checked against official Cisco documentation and IETF RFCs.