- Understand OSPF neighbor states (Init → 2-Way → ExStart → Exchange → Loading → Full)
- Know IPv4 /31 subnets and point-to-point link addressing
- Understand MPLS forwarding fundamentals: FIB, LFIB, label swap, PHP
- Understand LDP session establishment (TCP 646) and label space types
- Know MD5 authentication for OSPF and LDP
- Complete: Lab environment has GNS3/EVE-NG with IOS 15.2+ images loaded
| Router | Interface | IPv4 Address | IPv6 Address | Connected To |
|---|---|---|---|---|
| CORE-1 | Lo0 | 10.255.1.1/32 | 2001:db8:ff:1::1/128 | LDP Router-ID |
| CORE-1 | Gi0/0 | 10.0.12.0/31 | 2001:db8:0:12::1/64 | CORE-2 Gi0/0 |
| CORE-1 | Gi0/1 | 10.0.13.0/31 | 2001:db8:0:13::1/64 | CORE-3 Gi0/0 |
| CORE-1 | Gi0/2 | 10.0.101.0/31 | 2001:db8:0:101::1/64 | EDGE-1 Gi0/0 |
| CORE-2 | Lo0 | 10.255.1.2/32 | 2001:db8:ff:1::2/128 | LDP Router-ID |
| CORE-2 | Gi0/0 | 10.0.12.1/31 | 2001:db8:0:12::2/64 | CORE-1 Gi0/0 |
| CORE-2 | Gi0/1 | 10.0.24.0/31 | 2001:db8:0:24::2/64 | CORE-4 Gi0/0 |
| CORE-3 | Lo0 | 10.255.1.3/32 | 2001:db8:ff:1::3/128 | LDP Router-ID |
| CORE-3 | Gi0/0 | 10.0.13.1/31 | 2001:db8:0:13::3/64 | CORE-1 Gi0/1 |
| CORE-3 | Gi0/1 | 10.0.34.0/31 | 2001:db8:0:34::3/64 | CORE-4 Gi0/1 |
| CORE-4 | Lo0 | 10.255.1.4/32 | 2001:db8:ff:1::4/128 | LDP Router-ID |
| CORE-4 | Gi0/0 | 10.0.24.1/31 | 2001:db8:0:24::4/64 | CORE-2 Gi0/1 |
| CORE-4 | Gi0/1 | 10.0.34.1/31 | 2001:db8:0:34::4/64 | CORE-3 Gi0/1 |
- Enable OSPF process 1 on CORE-1, CORE-2, CORE-3, CORE-4. Use each router's Loopback0 IP as the router-ID (e.g., CORE-1:
router-id 10.255.1.1). - Advertise all Loopback0 addresses into OSPF area 0 as host routes (
/32). - Advertise all P2P backbone links (10.0.12.0/31, 10.0.13.0/31, 10.0.24.0/31, 10.0.34.0/31) into OSPF area 0.
- Set all P2P interfaces as
ip ospf network point-to-pointto eliminate DR/BDR election. - Set Loopback0 as passive-interface on all routers (prevent OSPF hellos on loopbacks).
show ip ospf neighbor on CORE-1. You must see CORE-2 and CORE-3 in FULL state. If any neighbor shows Init or 2-Way, check network statements and passive-interface settings.
- Configure area-wide MD5 authentication under OSPF process 1:
area 0 authentication message-digeston all CORE routers. - On each backbone interface, set:
ip ospf message-digest-key 7 md5 Nx9#mP2@qK. Key ID must be 7 on all routers — mismatched key IDs cause adjacency failure. - Verify adjacencies reform after authentication is enabled. OSPF should drop and re-establish all neighbors within 40 seconds (dead interval × 4).
show ip ospf interface GigabitEthernet0/0 and confirm: "Message digest authentication enabled" with "Key ID 7". Run show ip ospf neighbor — all neighbors must be FULL again.
- Set the global MPLS label range:
mpls label range 1000 9999on all CORE routers. This prevents label collisions with other MPLS applications. - Force LDP to use Loopback0 as transport address:
mpls ldp router-id Loopback0 force. The "force" keyword overrides any existing LDP sessions immediately. - Enable LDP autoconfig under OSPF:
mpls ldp autoconfig area 0insiderouter ospf 1. This enables LDP on all interfaces in OSPF area 0 automatically. - Verify LDP discovers peers by checking
show mpls ldp discovery— all backbone interfaces should appear.
show mpls ldp neighbor. You must see all adjacent P router loopbacks in Oper state. The "Transport" address should be the loopback (10.255.1.x), NOT a physical interface.
- On CORE-1, configure LDP password for each adjacent P router:
mpls ldp neighbor 10.255.1.2 password Fp6&kN3@sXandmpls ldp neighbor 10.255.1.3 password Fp6&kN3@sX. - Apply matching passwords on ALL peer routers (CORE-2 toward CORE-1 and CORE-4; CORE-3 toward CORE-1 and CORE-4; CORE-4 toward CORE-2 and CORE-3). LDP authentication is bidirectional — both sides must match.
- After authentication is configured, verify LDP sessions drop and re-establish (TCP connection reset on port 646). This may take 15–30 seconds.
show mpls ldp neighbor detail and confirm "TCP MD5 auth: enabled" appears for each session. If a session stays in "Non Existent" or "Initialized" state, check that passwords match exactly on both peers.
- On each backbone interface of all CORE routers, enable BFD:
bfd interval 300 min_rx 300 multiplier 3. This gives 900ms detection (300ms × 3 missed packets). - Enable BFD for OSPF globally:
bfd all-interfacesunderrouter ospf 1. OSPF will now use BFD instead of hello/dead timers for failure detection. - Also add
ip ospf bfddirectly on each backbone interface as a backup method.
show bfd neighbors. All sessions must show St=Up and Diag=No Diagnostic. Run show ip ospf interface Gi0/0 and confirm BFD is shown as "enabled". Failure detection is now <1 second instead of 40 seconds.
- From CORE-1, run
show mpls forwarding-tableand verify labels are assigned for CORE-4's loopback (10.255.1.4/32). The "Outgoing label" should NOT be "Untagged" for transit paths. - Run
traceroute mpls ipv4 10.255.1.4/32 origin 10.255.1.1from CORE-1. Verify MPLS LSP trace succeeds and shows label stack at each hop. - Check PHP (Penultimate Hop Popping): the router directly connected to CORE-4 (e.g., CORE-2 or CORE-3) should show "Pop Tag" as the outgoing label for 10.255.1.4/32. This is correct behavior — do NOT change it.
- Verify label range: run
show mpls label rangeon any CORE router. Should show "Configured range: 1000-9999 Static range: none".
LDP Router-ID and Transport Address
The LDP Router-ID determines the LDP Identifier (RouterID:0 for platform-wide label space). More importantly, it sets the transport address — the IP used to establish the TCP-646 session between LDP peers. Without force, the router may choose a physical interface address, which can cause session flaps if that interface goes down. Using Loopback0 force anchors LDP to the stable loopback. Both peers must be able to reach each other's LDP transport address via the IP routing table — which OSPF provides via the loopback advertisements.
LDP Autoconfig vs Manual Interface Configuration
Without mpls ldp autoconfig area 0, you must add mpls ip to each interface individually. Autoconfig automatically enables LDP on every interface participating in the specified OSPF area. This is preferred in production because adding a new link to OSPF area 0 automatically gets LDP — you cannot forget. However, be careful: if you have an interface in OSPF area 0 that should NOT run MPLS (e.g., a management link), you must explicitly exclude it with no mpls ip on that interface after autoconfig enables it.
PHP — Penultimate Hop Popping
PHP occurs when the penultimate (second-to-last) router on an LSP pops the label before forwarding to the final router. The final router (egress PE or CORE router) advertises the "implicit-null" label (3) for its own prefixes, signaling to the penultimate hop: "pop the label and send me native IP." This saves one lookup at the egress — it does not need to check the LFIB. You will see "Pop Tag" or "implicit-null" as the outgoing label at the penultimate hop in show mpls forwarding-table. This is correct — do NOT configure no mpls ip propagate-ttl unless specifically required.
Problem: LDP session stays in "Non Existent" after authentication
Cause: Password mismatch — one side has authentication configured, the other does not, OR key strings differ (case-sensitive). LDP drops the TCP session immediately on auth failure. Check with debug mpls ldp transport events — you'll see "MD5 authentication check failed".
show run | include ldp neighbor. Remove and re-add if unsure. LDP will auto-reconnect within 15 seconds.Problem: OSPF neighbors drop after enabling MD5 authentication
Cause: Authentication was enabled on the area but the key is not configured on one or more interfaces, OR different key IDs are used on the two ends of a link. Key ID 7 on one side and key ID 1 on the other = OSPF drops the neighbor. Check: show ip ospf interface Gi0/0 — it shows the key IDs in use.
clear ip ospf process after fixing to force re-establishment. The neighbor should reform within 40 seconds.Problem: MPLS labels assigned are outside 1000–9999 range
Cause: mpls label range 1000 9999 was configured AFTER LDP sessions were already established. The router continues using previously assigned labels until sessions are cleared.
clear mpls ldp neighbor * to force all LDP sessions to reset and re-negotiate labels within the new range. Verify with show mpls label range and show mpls forwarding-table.Try completing the tasks first. Only reveal when truly stuck or to verify your work after completion.
Type SOLUTION below to unlock the full configurations.
mpls label range 1000 9999 mpls ldp router-id Loopback0 force mpls ldp neighbor 10.255.1.2 password Fp6&kN3@sX mpls ldp neighbor 10.255.1.3 password Fp6&kN3@sX interface GigabitEthernet0/0 ip ospf authentication message-digest ip ospf message-digest-key 7 md5 Nx9#mP2@qK ip ospf network point-to-point ip ospf bfd mpls ip bfd interval 300 min_rx 300 multiplier 3 interface GigabitEthernet0/1 ip ospf authentication message-digest ip ospf message-digest-key 7 md5 Nx9#mP2@qK ip ospf network point-to-point ip ospf bfd mpls ip bfd interval 300 min_rx 300 multiplier 3 interface GigabitEthernet0/2 ip ospf authentication message-digest ip ospf message-digest-key 7 md5 Nx9#mP2@qK ip ospf network point-to-point ip ospf bfd mpls ip bfd interval 300 min_rx 300 multiplier 3 router ospf 1 router-id 10.255.1.1 area 0 authentication message-digest passive-interface Loopback0 network 10.255.1.1 0.0.0.0 area 0 network 10.0.12.0 0.0.0.1 area 0 network 10.0.13.0 0.0.0.1 area 0 network 10.0.101.0 0.0.0.1 area 0 mpls ldp autoconfig area 0 bfd all-interfaces
mpls label range 1000 9999 mpls ldp router-id Loopback0 force mpls ldp neighbor 10.255.1.1 password Fp6&kN3@sX mpls ldp neighbor 10.255.1.4 password Fp6&kN3@sX interface GigabitEthernet0/0 ip ospf authentication message-digest ip ospf message-digest-key 7 md5 Nx9#mP2@qK ip ospf network point-to-point ip ospf bfd mpls ip bfd interval 300 min_rx 300 multiplier 3 interface GigabitEthernet0/1 ip ospf authentication message-digest ip ospf message-digest-key 7 md5 Nx9#mP2@qK ip ospf network point-to-point ip ospf bfd mpls ip bfd interval 300 min_rx 300 multiplier 3 interface GigabitEthernet0/2 ip ospf authentication message-digest ip ospf message-digest-key 7 md5 Nx9#mP2@qK ip ospf network point-to-point ip ospf bfd mpls ip bfd interval 300 min_rx 300 multiplier 3 router ospf 1 router-id 10.255.1.2 area 0 authentication message-digest passive-interface Loopback0 network 10.255.1.2 0.0.0.0 area 0 network 10.0.12.0 0.0.0.1 area 0 network 10.0.24.0 0.0.0.1 area 0 network 10.0.102.0 0.0.0.1 area 0 mpls ldp autoconfig area 0 bfd all-interfaces
! CORE-3 specific: mpls ldp neighbor 10.255.1.1 password Fp6&kN3@sX mpls ldp neighbor 10.255.1.4 password Fp6&kN3@sX router ospf 1 router-id 10.255.1.3 ! (or 10.255.1.4 for CORE-4) area 0 authentication message-digest network 10.255.1.3 0.0.0.0 area 0 ! adjust per router network 10.0.13.0 0.0.0.1 area 0 ! adjust per router network 10.0.34.0 0.0.0.1 area 0 mpls ldp autoconfig area 0 bfd all-interfaces ! CORE-4 neighbors: ! mpls ldp neighbor 10.255.1.2 password Fp6&kN3@sX ! mpls ldp neighbor 10.255.1.3 password Fp6&kN3@sX