MPLS MASTERCLASS · CHAPTER 6

Verifying and troubleshooting the L3VPN

The commands that check each layer, why OSPF arrives as O IA or O E2, and what happens when the route target doesn't match.

13 min readVideo: Day 1, part 7Level: intermediate to advanced

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.

What you'll see
  1. A layer-by-layer method: IGP, LDP, BGP VPNv4, VRF and PE-CE
  2. The verification commands for the core and for BGP VPNv4
  3. O IA versus O E2 depending on the OSPF process
  4. Troubleshooting the route target with 999:999
  5. 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.

Troubleshooting the L3VPN layer by layer Five layers, checked in order. 1, IGP: OSPF in the core must reach every loopback; check with show ip route and ping. 2, LDP: every core interface must run MPLS and have LDP neighbors; check with show mpls interfaces, show mpls ldp neighbor, show mpls ldp bindings and show mpls forwarding-table. 3, MP-BGP VPNv4: the iBGP session between the PEs must be up with the VPNv4 address family activated and extended communities sent; check with show bgp vpnv4 unicast. 4, VRF and route target: the import and export route targets must match; check with show run section vrf, show ip vrf and show ip route vrf. 5, PE-CE: OSPF 20 in the VRF and the redistribution in both directions; check from the CE with show ip route, ping and traceroute. LAYER CHECK WITH · IF IT FAILS, LOOK AT 1 · IGP OSPF 1 · area 0 · core show ip route 4.4.4.4 ping 4.4.4.4 source loopback0 fails? → loopback missing · OSPF neighbor down 2 · LDP labels for the loopbacks show mpls interfaces · show mpls ldp neighbor show mpls ldp bindings · show mpls forwarding-table fails? → mpls ip missing on a link · no LDP session 3 · MP-BGP VPNv4 iBGP PE-1 ↔ PE-2 show bgp vpnv4 unicast all summary show bgp vpnv4 unicast vrf TU-CA1 fails? → neighbor not activated · no send-community 4 · VRF / RT import · export show run | section vrf · show ip vrf show ip route vrf TU-CA1 fails? → route target mismatch · interface not in VRF 5 · PE-CE OSPF 20 per VRF show ip route (on the CE) ping vrf · traceroute vrf fails? → redistribution missing · CE adjacency down Each layer depends on the one below it: confirm the symptom on the CE, then check from layer 1 up.

Five layers, each with its commands and its typical failures. Diagram: The House of Routing.

The method we suggest:

  1. Define the symptom precisely. Which source, which destination, what fails: is the route missing or is the reply missing? Test from the CE with source set to the loopback.
  2. Confirm the core IGP. Each PE must see the other's loopback (4.4.4.4 and 1.1.1.1).
  3. Confirm LDP. Neighbors up and an outgoing label toward the remote PE's loopback at every hop.
  4. Confirm BGP VPNv4. The session between the PEs established and the prefixes received.
  5. Confirm the VRF and the route target. The RT one side exports is the one the other side imports.
  6. Confirm the PE-CE. The VRF's OSPF adjacency and redistribution in both directions.
  7. 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 discovery and show 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).
What matters most. Check the entry for the remote PE's loopback, the one BGP uses as next hop. If any hop shows no outgoing label where there should be one, the transport path is broken even if the loopback-to-loopback ping answers.

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 20 on 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 OSPF domain or not: O IA or O E2 The OSPF domain ID travels with each VPNv4 route as a BGP extended community. In the lab, without a domain-id command, it follows the process number. If both PEs run router ospf 20 in the VRF, the domain matches and PE-2 announces the remote routes to CE-A2 as type 3 summary LSAs: the CE sees them as O IA. If PE-1 runs process 20 and PE-2 runs process 30, the domains differ and PE-2 uses type 5 external LSAs: the CE sees O E2. SAME DOMAIN CE-A1 OSPF area 0 PE-1 router ospf 20 vrf PE-2 router ospf 20 vrf CE-A2 sees O IA VPNv4 domain ID type 3 summary LSA DIFFERENT DOMAIN CE-A1 OSPF area 0 PE-1 router ospf 20 vrf PE-2 router ospf 30 vrf CE-A2 sees O E2 VPNv4 domain ID type 5 external LSA

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.

Good to know. The LSAs a PE generates from BGP carry the DN (down) bit. If such an LSA comes back to another PE through a customer link, that PE ignores it and doesn't reinject it into BGP. It's the loop protection Cisco documents for OSPF as the PE-CE protocol.

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:

DesignHow it's done with RTs
Full meshEvery site exports and imports the same RT (our 3:3)
Hub and spokeTwo RTs: the hub exports its own and imports the spokes' RT; the spokes do the opposite. Spokes don't see each other
ExtranetSites from different organizations share an extra RT, like 999:999 in the exercise
Shared servicesOne RT per service (cloud, backup, telephony) that each VRF imports according to what it bought
The route target decides what each VRF imports Three moments of the lab. A, baseline: both VRFs export and import route target 3:3, so the routes 30.30.30.30 and 40.40.40.40 are exchanged. B, fault: TU-CA2 changes to route-target both 999:999; TU-CA1 still only knows 3:3, so neither VRF imports the other's routes and the CEs lose them. C, fix: TU-CA1 adds route-target both 999:999 and keeps 3:3; now both VRFs share 999:999 and end-to-end connectivity comes back. A · OK PE-1 · VRF TU-CA1 both 3:3 PE-2 · VRF TU-CA2 both 3:3 ✓ routes exchanged B · FAULT PE-1 · VRF TU-CA1 both 3:3 PE-2 · VRF TU-CA2 both 999:999 ✗ no common RT · no routes C · FIX PE-1 · VRF TU-CA1 both 3:3 · both 999:999 PE-2 · VRF TU-CA2 both 999:999 ✓ 999:999 in common

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

SymptomCommandLikely cause
No LDP neighbor on a core linkshow mpls interfaces, show mpls ldp discoverympls ip missing on the interface, or the LDP loopback is not reachable through the IGP
The remote PE's loopback has no outgoing labelshow mpls forwarding-tableLDP down on one segment: the transport LSP is broken
show ip bgp is empty on the PEshow bgp vpnv4 unicast allNothing: VPN routes live in VPNv4
No VPNv4 prefixes from the other PEshow bgp vpnv4 unicast all summaryiBGP session down, or neighbor without activate in VPNv4
The prefix arrives without a route targetshow bgp vpnv4 unicast vrf with the prefixsend-community both or extended missing
The prefix is in BGP but not in the VRFshow run | section vrfThe import RT doesn't match the other side's export RT
The VRF has the route, the CE doesn'tshow ip route on the CE, show run | section ospfredistribute bgp 100 subnets missing in the VRF's OSPF
The CE sees O E2 where you expected O IAshow ip route on the CEDifferent OSPF processes or domain IDs on the PEs
The CE shows the route but the ping failsping with source, show bgp vpnv4 unicast vrfStale route waiting for convergence after a change
A ping from a P router to the customer network failsshow ip route on the PNothing: 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 with show 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

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.

Navigate