How to implement Cisco L3 MPLS to connect four customer branches pt3

Previously on this topic, I configured physical and loopback interface IPs, ospf for reachability among mpls routers, and enabled mbgp to carry vpn4 traffic between the provider edge routers.

In this post, I will configure virtual routing and forwarding on the PE routers, ospf to advertise route from customers into the VRFs, and redistrute between ospf and bgp so that routes learned via vrf can be advertised to all bgp-speaking PE routers.

Before proceeding, I will urge you to go read the part 1 and 2 of this topic if you haven’t. You can find them here and here.

Configuring vrf on PE routers

PHC-PE
PHC-PE(config)#ip vrf 001:PHC

PHC-PE (config-vrf)#rd 2.2.2.2:1

PHC-PE (config-vrf)#route-target export 2.2.2.2:1

PHC-PE (config-vrf)#route-target import 3.3.3.3:1

PHC-PE (config-vrf)#route-target import 4.4.4.4:1

PHC-PE (config-vrf)#route-target import 5.5.5.5:1

PHC-PE (config-vrf)#exit

PHC-PE (config)#int g4/0

PHC-PE (config-if)#ip vrf forwarding

PHC-PE (config-vrf)#ip add 192.168.1.1 255.255.255.252

Note that the vrf command removes previously configured IP on an interface.

LAG-PE
LAG-PE(config)#ip vrf 001:LAG

LAG -PE (config-vrf)#rd 3.3.3.3:1

LAG -PE (config-vrf)#route-target export 3.3.3.3:1

LAG -PE (config-vrf)#route-target import 2.2.2.2:1

LAG -PE (config-vrf)#route-target import 4.4.4.4:1

LAG -PE (config-vrf)#route-target import 5.5.5.5:1

LAG -PE (config-vrf)#exit

LAG -PE (config)#int g4/0

LAG -PE (config-if)#ip vrf forwarding

LAG -PE (config-vrf)#ip add 192.168.2.1 255.255.255.252
KAN-PE
KAN-PE(config)#ip vrf 001:KAN

KAN -PE (config-vrf)#rd 4.4.4.4:1

KAN -PE (config-vrf)#route-target export 4.4.4.4:1

KAN -PE (config-vrf)#route-target import 2.2.2.2:1

KAN -PE (config-vrf)#route-target import 3.3.3.3:1

KAN -PE (config-vrf)#route-target import 5.5.5.5:1

KAN -PE (config-vrf)#exit

KAN -PE (config)#int g4/0

KAN -PE (config-if)#ip vrf forwarding

KAN -PE (config-vrf)#ip add 192.168.3.1 255.255.255.252
ABJ-PE
ABJ-PE(config)#ip vrf 001:ABJ

ABJ-PE (config-vrf)#rd 5.5.5.5:1

ABJ-PE (config-vrf)#route-target export 5.5.5.5:1

ABJ-PE (config-vrf)#route-target import 2.2.2.2:1

ABJ-PE (config-vrf)#route-target import 3.3.3.3:1

ABJ-PE (config-vrf)#route-target import 4.4.4.4:1

ABJ-PE (config-vrf)#exit

ABJ-PE (config)#int g4/0

ABJ-PE (config-if)#ip vrf forwarding

ABJ-PE (config-vrf)#ip add 192.168.5.1 255.255.255.252

! Configure ospf on PE routers and redistribute bgp routes into ospf

PHC-PE
PHC-PE(config)#router ospf 101 vrf 001:PHC
PHC-PE(config-router)#netw 192.168.1.0 0.0.0.3 area 0
PHC-PE(config-router)#redistribute bgp 65535 subnets

! Redistrinute ospf 101 for vrf 001:PHC into bgp 65535

PHC-PE(config)#router bgp 65535
PHC-PE(config-router)#address-family ipv4 vrf 001:PHC
PHC-PE(config-router)#redistribute ospf 101 vrf 001:PHC

LAG-PE

Configure Ospf on LAG-PE router and redistrinute bgp into ospf

LAG-PE(config)#router ospf 101 vrf 001:LAG
LAG-PE(config-router)#netw 192.168.2.0 0.0.0.3 area 0
LAG-PE(config-router)#redistribute bgp 65535 subnets

! Redistribute ospf 101 for vrf 001:LAG into bgp 65535

LAG-PE(config)#router bgp 65535
LAG-PE(config-router)#address-family ipv4 vrf 001:LAG
LAG-PE(config-router)#redistribute ospf 101 vrf 001:LAG

Configure Ospf on KAN-PE router and redistrinute bgp into ospf

KAN-PE(config)#router ospf 101 vrf 001:KAN
KAN-PE(config-router)#netw 192.168.3.0 0.0.0.3 area 0
KAN-PE(config-router)#redistribute bgp 65535 subnets

! Redistrinute ospf 101 for vrf 001:KAN into bgp 65535

KAN-PE(config)#router bgp 65535
KAN-PE(config-router)#address-family ipv4 vrf 001:KAN
KAN-PE(config-router)#redistribute ospf 101 vrf 001:KAN

Configure Ospf on ABJ-PE router and redistrinute bgp into ospf

ABJ-PE(config)#router ospf 101 vrf 001:ABJ
ABJ-PE(config-router)#netw 192.168.4.0 0.0.0.3 area 0
ABJ-PE(config-router)#redistribute bgp 65535 subnets

! Redistrinute ospf 101 for vrf 001:ABJ into bgp 65535

ABJ-PE(config)#router bgp 65535
ABJ-PE(config-router)#address-family ipv4 vrf 001:ABJ
ABJ-PE(config-router)#redistribute ospf 101 vrf 001:ABJ

Configuring Customer edge routers

PHC-CE
PHC-CE(config)#interface Loopback0

PHC-CE (config-if)#ip address 6.6.6.6 255.255.255.255

PHC-CE (config-if)#interface GigabitEthernet1/0

PHC-CE (config-if)# ip address 192.168.1.2 255.255.255.252

PHC-CE (config-if)#no shut

PHC-CE (config-if)#exit

PHC-CE (config)#router ospf 101

PHC-CE (config-router)#log-adjacency-changes

PHC-CE (config-router)#no auto

PHC-CE (config-router)# network 6.6.6.6 0.0.0.0 area 0

PHC-CE (config-router)#network 192.168.1.0 0.0.0.3 area 0
LAG-CE
LAG-CE(config)#interface Loopback0

LAGCE (config-if)#ip address 7.7.7.7 255.255.255.255

LAG-CE (config-if)#interface GigabitEthernet1/0

LAG-CE (config-if)# ip address 192.168.2.2 255.255.255.252

LAG-CE (config-if)#no shut

LAG-CE (config-if)#exit

LAG-CE (config)#router ospf 101

LAG-CE (config-router)#log-adjacency-changes

LAG-CE (config-router)#no auto

LAG-CE (config-router)# network 7.7.7.7 0.0.0.0 area 0

LAG-CE (config-router)#network 192.168.2.0 0.0.0.3 area 0
KAN-CE
KAN-CE(config)#interface Loopback0

KAN-CE (config-if)#ip address 8.8.8.8 255.255.255.255

KAN-CE (config-if)#interface GigabitEthernet1/0

KAN-CE (config-if)# ip address 192.168.3.2 255.255.255.252

KAN-CE (config-if)#no shut

KAN-CE (config-if)#exit

KAN-CE (config)#router ospf 101

KAN-CE (config-router)#log-adjacency-changes

KAN-CE (config-router)#no auto

KAN-CE (config-router)# network 8.8.8.8 0.0.0.0 area 0

KAN-CE (config-router)#network 192.168.3.0 0.0.0.3 area 0
ABJ-CE
ABJ-CE(config)#interface Loopback0

ABJ-CE (config-if)#ip address 9.9.9.9 255.255.255.255

ABJ-CE (config-if)#interface GigabitEthernet1/0

ABJ-CE (config-if)# ip address 192.168.4.2 255.255.255.252

ABJ-CE (config-if)#no shut

ABJ-CE (config-if)#exit

ABJ-CE (config)#router ospf 101

ABJ-CE (config-router)#log-adjacency-changes

ABJ-CE (config-router)#no auto

ABJ-CE (config-router)# network 9.9.9.9 0.0.0.0 area 0

ABJ-CE (config-router)#network 192.168.4.0 0.0.0.3 area 0

Verify reachability to the loopback addresses (which represent the LAN) configured on other customer edge routers.

Let’s verify that mpls ldp is used instead of IP.

The trace result above shows the label switching paths taken from the customer site at PHC to other branches. Note that there are three LSPs to each destination and that the PE router will automatically switch to another LSP of the primary goes down.

If you enjoyed this tutorial, please subscribe to this blog to receive my posts via email. Also subscibe to my YouTube channel, like my Facebook page and follow me on Twitter.

Spread the love

2 thoughts on “How to implement Cisco L3 MPLS to connect four customer branches pt3”

  1. This is a very good explanation on MPLS VPN for beginners, I have liked it very much and thank you very much. Could I suggest some improvement ?
    1. Include some LAN’s at the customer end for the reader to view the end to end connectivity
    2. Include some configuration verification e.g. How to ping from PE to CE, how to verify that the bgp vpnv4 tables have been populated with routes (before and after vrf setup)
    3. Introduce route reflector to demonstrate scalability
    4. Some explanation on PE-CE & PE-PE routing

    Reply

Leave a Comment