Complete Cisco IOS XR MPLS L3VPN Configuration Guide Part 1
In this complete MPLS L3VPN educational guide, we will configure a full Cisco IOS XR MPLS core environment using OSPF, ISIS, MPLS LDP, MP-iBGP, VPNv4, and Route Reflectors.
This article is designed for beginners, intermediate engineers, CCNP SP students, CCIE SP candidates, and enterprise engineers who want deep practical understanding of MPLS VPN architectures.
๐ฏ What You Will Learn
- How MPLS works internally
- OSPF configuration in IOS XR
- ISIS configuration in IOS XR
- MPLS LDP configuration
- MP-iBGP VPNv4 architecture
- Route Reflector concepts
- Loopback design best practices
- MPLS label distribution logic
- VPNv4 route advertisement
- Verification and troubleshooting
Table of Contents
- 1. MPLS Introduction
- 2. OSPF AS100 Core Configuration
- 3. XR1 Configuration
- 4. XR2 Configuration
- 5. XR3 Configuration
- 6. XR4 Configuration
- 7. MP-iBGP Configuration AS100
- 8. ISIS AS200 Core Configuration
- 9. XR5 Configuration
- 10. XR6 Configuration
- 11. XR7 Configuration
- 12. XR8 Configuration
- 13. MPLS LDP Configuration
- 14. MP-iBGP Configuration AS200
- 15. Verification Commands
- 16. Troubleshooting
- 17. MPLS Mathematics
- 18. Related Articles
1. MPLS Introduction
MPLS stands for Multiprotocol Label Switching.
Traditional IP routing performs hop-by-hop routing lookups using destination IP addresses.
MPLS improves forwarding efficiency using labels instead of repeated routing lookups.
MPLS Forwarding Formula
$$ Forwarding = Label\\ Lookup + LFIB $$Where:
- LFIB = Label Forwarding Information Base
- Labels identify forwarding paths
- MPLS reduces routing lookup complexity
IP Routing Complexity
$$ Routing\\ Complexity = O(n) $$MPLS reduces repeated routing decisions by using label switching.
2. OSPF Configuration for AS100
OSPF is configured as the Interior Gateway Protocol for AS100.
OSPF distributes loopback and transit network reachability between routers.
Loopback interfaces are extremely important because:
- They provide stable router IDs
- They serve as BGP update-source interfaces
- They improve network resiliency
- They remain active even if physical interfaces fail
OSPF SPF Calculation
$$ Shortest\\ Path = Min(Cost_1 + Cost_2 + Cost_n) $$OSPF uses Dijkstra's SPF algorithm.
3. XR1 Configuration
XR1 belongs to AS100 and runs OSPF.
Code Example
router ospf 1
This initializes OSPF process 1.
R1 hostname XR1 interface Gig0/0/0/0 ip address 192.1.13.1 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.100.1 255.255.255.0 no shut interface loopback0 ip address 1.1.1.1 255.255.255.255 router ospf 1 router-id 0.0.0.1 area 0 interface Gig0/0/0/0 exit interface Gig0/0/0/1 exit interface Loopback0 exit commit
Detailed Explanation
The command:
router-id 0.0.0.1
defines a unique OSPF identifier.
Area 0 is the OSPF backbone area.
All interfaces participating in OSPF are added under Area 0.
Expected OSPF Neighbor Output
XR1#show ospf neighbor Neighbor ID Pri State Dead Time Address 0.0.0.3 1 FULL/DR 00:00:38 192.1.13.3
4. XR2 Configuration
R2 hostname XR2 interface Gig0/0/0/0 ip address 192.1.23.2 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.100.2 255.255.255.0 no shut interface loopback0 ip address 2.2.2.2 255.255.255.255 router ospf 1 router-id 0.0.0.2 area 0 interface Gig0/0/0/0 exit interface Gig0/0/0/1 exit interface Loopback0 exit commit
Why Use Loopbacks?
Loopbacks are always preferred for:
- BGP peering
- Router IDs
- LDP Router IDs
- MPLS stability
5. XR3 Configuration
R3 hostname XR3 interface Gig0/0/0/0 ip address 192.1.13.3 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.23.3 255.255.255.0 no shut interface loopback0 ip address 3.3.3.3 255.255.255.255 router ospf 1 router-id 0.0.0.3 area 0 interface Gig0/0/0/0 exit interface Gig0/0/0/1 exit interface Loopback0 exit commit
๐ก Important Note
XR3 later becomes the Route Reflector for VPNv4 routes.
This reduces full-mesh iBGP requirements.
6. XR4 Configuration
R4 hostname XR4 interface Gig0/0/0/0 ip address 192.1.34.4 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.100.4 255.255.255.0 no shut interface Gig0/0/0/2 ip address 192.1.34.3 255.255.255.0 no shut interface loopback0 ip address 4.4.4.4 255.255.255.255 router ospf 1 router-id 0.0.0.4 area 0 interface Gig0/0/0/0 exit interface Gig0/0/0/1 exit interface Loopback0 exit commit
7. MP-iBGP VPNv4 Configuration for AS100
MP-BGP distributes VPNv4 routes inside MPLS networks.
Standard IPv4 BGP cannot carry VPN labels and Route Targets.
VPNv4 extends BGP functionality.
VPNv4 Route Formula
$$ VPNv4 = RD + IPv4\\ Prefix $$Example:
$$ 100:1 + 10.1.1.0/24 $$R1 MP-iBGP Configuration
R1 router bgp 100 address-family vpnv4 unicast exit neighbor 3.3.3.3 remote-as 100 update-source Loopback0 address-family vpnv4 unicast
R2 MP-iBGP Configuration
R2 router bgp 100 address-family vpnv4 unicast exit neighbor 3.3.3.3 remote-as 100 update-source Loopback0 address-family vpnv4 unicast
R3 Route Reflector Configuration
R3 router bgp 100 address-family vpnv4 unicast exit neighbor-group MP-iBGP remote-as 100 update-source Loopback0 address-family vpnv4 unicast route-reflector-client exit exit neighbor 1.1.1.1 use neighbor-group MP-iBGP exit neighbor 2.2.2.2 use neighbor-group MP-iBGP exit commit
What is a Route Reflector?
Normally iBGP requires full mesh connectivity.
The number of iBGP sessions grows rapidly:
$$ Sessions = \frac{n(n-1)}{2} $$Where:
- \(n\) = Number of routers
Route Reflectors eliminate this scaling issue.
iBGP Full Mesh Formula
$$ Sessions = \frac{n(n-1)}{2} $$If:
$$ n=100 $$Then:
$$ Sessions = 4950 $$Route Reflectors dramatically reduce this number.
8. ISIS Configuration for AS200
ISIS is another Interior Gateway Protocol commonly used in Service Provider environments.
ISIS is preferred because:
- It scales extremely well
- It handles MPLS efficiently
- It supports large provider cores
- It converges quickly
ISIS NET Structure
$$ NET = Area\\ ID + System\\ ID + NSEL $$9. XR5 Configuration
R5 hostname XR5 interface Gig0/0/0/0 ip address 192.1.57.5 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.200.5 255.255.255.0 no shut interface loopback0 ip address 5.5.5.5 255.255.255.255 router isis 1 net 49.0000.5555.5555.5555.00 is-type level-2-only address-family ipv4 unicast metric-style wide exit interface Gig0/0/0/0 address-family ipv4 unicast exit exit interface Gig0/0/0/1 address-family ipv4 unicast exit exit interface Loopback0 address-family ipv4 unicast exit exit commit
Why Wide Metrics?
Wide metrics extend ISIS scalability.
Traditional narrow metrics have limited values.
Wide metrics support Traffic Engineering and large topologies.
10. XR6 Configuration
R6 hostname XR6 interface Gig0/0/0/0 ip address 192.1.67.6 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.200.6 255.255.255.0 no shut interface loopback0 ip address 6.6.6.6 255.255.255.255 router isis 1 net 49.0000.6666.6666.6666.00 is-type level-2-only address-family ipv4 unicast metric-style wide exit interface Gig0/0/0/0 address-family ipv4 unicast exit exit interface Gig0/0/0/1 address-family ipv4 unicast exit exit interface Loopback0 address-family ipv4 unicast exit exit commit
11. XR7 Configuration
R7 hostname XR7 interface Gig0/0/0/0 ip address 192.1.57.7 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.67.7 255.255.255.0 no shut interface Gig0/0/0/2 ip address 192.1.78.7 255.255.255.0 no shut interface loopback0 ip address 7.7.7.7 255.255.255.255 router isis 1 net 49.0000.7777.7777.7777.00 is-type level-2-only address-family ipv4 unicast metric-style wide exit interface Gig0/0/0/0 address-family ipv4 unicast exit exit interface Gig0/0/0/1 address-family ipv4 unicast exit exit interface Gig0/0/0/2 address-family ipv4 unicast exit exit interface Loopback0 address-family ipv4 unicast exit exit commit
12. XR8 Configuration
R8 hostname XR8 interface Gig0/0/0/0 ip address 192.1.78.8 255.255.255.0 no shut interface Gig0/0/0/1 ip address 192.1.200.8 255.255.255.0 no shut interface loopback0 ip address 8.8.8.8 255.255.255.255 router isis 1 net 49.0000.8888.8888.8888.00 is-type level-2-only address-family ipv4 unicast metric-style wide exit interface Gig0/0/0/0 address-family ipv4 unicast exit exit interface Gig0/0/0/1 address-family ipv4 unicast exit exit interface Loopback0 address-family ipv4 unicast exit exit commit
13. MPLS LDP Configuration
LDP distributes MPLS labels between routers.
Without LDP, MPLS forwarding cannot occur.
Label Switching Formula
$$ Incoming\\ Label \rightarrow Outgoing\\ Label $$XR5 LDP Configuration
R5 mpls ldp router-id 5.5.5.5 interface gig0/0/0/0 exit interface gig0/0/0/1 exit commit
XR6 LDP Configuration
R6 mpls ldp router-id 6.6.6.6 interface gig0/0/0/0 exit interface gig0/0/0/1 exit commit
XR7 LDP Configuration
R7 mpls ldp router-id 7.7.7.7 interface gig0/0/0/0 exit interface gig0/0/0/1 exit interface gig0/0/0/2 exit commit
XR8 LDP Configuration
R8 mpls ldp router-id 8.8.8.8 interface gig0/0/0/0 exit interface gig0/0/0/1 exit commit
14. MP-iBGP VPNv4 Configuration for AS200
XR5 Configuration
R5 router bgp 200 address-family vpnv4 unicast exit neighbor 7.7.7.7 remote-as 200 update-source Loopback0 address-family vpnv4 unicast commit
XR6 Configuration
R6 router bgp 200 address-family vpnv4 unicast exit neighbor 7.7.7.7 remote-as 200 update-source Loopback0 address-family vpnv4 unicast commit
XR7 Route Reflector Configuration
R7 router bgp 200 address-family vpnv4 unicast exit neighbor-group MP-iBGP remote-as 200 update-source Loopback0 address-family vpnv4 unicast route-reflector-client exit exit neighbor 5.5.5.5 use neighbor-group MP-iBGP exit neighbor 6.6.6.6 use neighbor-group MP-iBGP exit commit
15. Verification Commands
Verify OSPF Neighbors
show ospf neighbor
Verify ISIS Neighbors
show isis neighbors
Verify MPLS LDP Neighbors
show mpls ldp neighbor
Verify VPNv4 BGP Sessions
show bgp vpnv4 unicast neighbors
Expected BGP Neighbor Output
XR7#show bgp vpnv4 unicast neighbors BGP neighbor is 5.5.5.5 Remote AS 200 BGP state = Established
16. Troubleshooting MPLS Networks
| Problem | Cause | Solution |
|---|---|---|
| OSPF neighbor down | Area mismatch | Verify Area 0 configuration |
| ISIS adjacency missing | NET issue | Check NET addressing |
| LDP session failure | IGP reachability missing | Verify loopback reachability |
| BGP VPNv4 down | Update-source missing | Use Loopback0 |
| No VPN routes | VPNv4 AF missing | Enable vpnv4 address-family |
17. MPLS Mathematics and Networking Logic
End-to-End Label Switching
$$ Ingress\\ PE \rightarrow P\\ Router \rightarrow Egress\\ PE $$Traffic Flow Equation
$$ Bandwidth = \frac{Data}{Time} $$OSPF Cost Formula
$$ Cost = \frac{Reference\\ Bandwidth}{Interface\\ Bandwidth} $$Label Distribution Logic
$$ FEC \rightarrow Label\\ Mapping $$FEC means Forwarding Equivalence Class.
๐ก Key Takeaways
- OSPF and ISIS provide MPLS reachability
- LDP distributes labels
- Loopbacks are critical for stability
- MP-BGP distributes VPNv4 routes
- Route Reflectors reduce iBGP scaling problems
- MPLS improves forwarding efficiency
18. Related Articles
- Complete Cisco IOS XR MPLS L3VPN Configuration Guide Part 2 | VRF, Route Targets, PE-CE BGP & VPNv4
- Complete Cisco Nexus VXLAN EVPN
- Complete Cisco Nexus VXLAN
- Complete Cisco Nexus BGP Authentication
- Complete Cisco Nexus OSPF
- Complete Cisco Nexus EIGRP
- Cisco Nexus vPC and LACP Configuration
Final Conclusion
This Part 1 MPLS L3VPN guide covered the complete MPLS underlay setup using Cisco IOS XR.
We configured:
- OSPF Core
- ISIS Core
- MPLS LDP
- MP-iBGP VPNv4
- Route Reflectors
- Loopback reachability
These technologies form the foundation of large-scale MPLS service provider networks.
In upcoming parts, VRFs, Route Targets, VPN customers, and MPLS Layer 3 VPN services can be added on top of this infrastructure.
No comments:
Post a Comment