MPLS Layer 3 VPN PE-CE OSPF

Hi Chris,

I didn’t create a lesson for this (yet). In OSPF, it’s simple since the DN bit is set automatically. You need this in a scenario where you have two OSPF customer routers that are connected to each other on the same site. Cisco does have a good example for this:

Rene

On CE routers why can’t I see MPLS label in traceroute result?

CE1#trace 5.5.5.5

Type escape sequence to abort.
Tracing the route to 5.5.5.5

  1 192.168.12.2 8 msec 16 msec 20 msec
  2 192.168.23.3 36 msec 52 msec 64 msec
  3 192.168.45.4 28 msec 24 msec 40 msec
  4 192.168.45.5 64 msec 68 msec 64 msec

Hi Admin,
I have one question:
When i create default-route (S*) on the CE2 and advertise into OSPF with command:

default-information originate metric 10 metric-type 1

then PE2 receives O*E1 0.0.0.0/0 [110/20] via 192.168.45.5, 00:00:31, Ethernet0/1
But PE2 does not advertise -> PE1and CE1 .

Could you help me?
Routing table CE1:

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O IA     5.5.5.5 [110/21] via 192.168.12.2, 00:13:31, Ethernet0/0
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.1/32 is directly connected, Ethernet0/0
O IA  192.168.45.0/24 [110/11] via 192.168.12.2, 00:13:31, Ethernet0/0

@ReneMolenaar
Many thanks!

Hi Kenneth,

By default, you should see it:

CE1#traceroute 5.5.5.5
Type escape sequence to abort.
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.12.2 2 msec 2 msec 3 msec
  2 192.168.23.3 [MPLS: Labels 16/19 Exp 0] 6 msec 5 msec 4 msec
  3 192.168.45.4 [MPLS: Label 19 Exp 0] 4 msec 8 msec 5 msec
  4 192.168.45.5 4 msec 4 msec *

Unless you enable this command on the P and PE routers:

P, PE1 & PE2
(config)#no mpls ip propagate-ttl

Any chance you have that command on your routers?

Rene

Hello Nguyen,

By default, default routes from an IGP like OSPF are not redistributed into BGP. You can verify it like this:

CE2(config)#ip route 0.0.0.0 0.0.0.0 null

CE2(config)#router ospf 1
CE2(config-router)#default-information originate metric 10 metric-type 1 

PE2 has it in its routing table:

PE2#show ip route vrf CUSTOMER ospf | include 0.0.0.0/0
O*E1  0.0.0.0/0 [110/11] via 192.168.45.5, 00:01:14, GigabitEthernet0/1

But it’s not in the BGP table:

PE2#show bgp vrf CUSTOMER
BGP table version is 7, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
              t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf CUSTOMER)
 *>i  1.1.1.1/32       2.2.2.2                  2    100      0 ?
 *>   5.5.5.5/32       192.168.45.5             2         32768 ?
 *>i  192.168.12.0     2.2.2.2                  0    100      0 ?
 *>   192.168.45.0     0.0.0.0                  0         32768 ?

This only applies to non-BGP routing protocols like OSPF or EIGRP. When you use BGP as the PE-CE routing protocol, the default route is normally advertised. If you want to fix this, you manually have to add the default route in the VRF of your PE routers like this:

PE1 & PE2
(config)#router bgp 234
(config-router)#address-family ipv4 vrf CUSTOMER
(config-router-af)#default-information originate

Rene

Okies, thanh Rene :smiley:

Is OSPF domain ID used anywhere else besides mpls vpn?

Hello Andrew

The OSPF domain ID is used as a BGP Extended Community Attribute. It’s primary use is indeed with MPLS VPNs. I am not familiar with any other uses of this particular attribute.

I hope this has been helpful!

Laz

1 Like

First time to trial with this LAB being the first to setup within VIRL. I used different interfaces numbers/types, yet all worked well. VIRL would be a def use-case for the topology ideas to practice hard with adding steps to better ones understanding. The information was pleasant to follow and plan to be a full member after trial. I also used VRF ‘definition’ with adding a few address families under the context. I used simple VIRl ‘iosv’ types to complete the LAB to try again without training wheels (Kind of; I had to peak about domain ID type to grasp when I changed the process ID).

Hello Adrian

Great to hear that your first experience with the lab was good. If you have questions or concerns, you know where to find us… :sunglasses:

Laz

I’ve got some error messages for the ibgp session

Jun  7 11:58:35.511: %BGP-3-NOTIFICATION: received from neighbor 2.2.2.2 1/1 (header synchronization problems) 0 bytes 
R4#
*Jun  7 11:58:35.511: %BGP-5-NBR_RESET: Neighbor 2.2.2.2 reset (BGP Notification received)
*Jun  7 11:58:35.519: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down BGP Notification received
*Jun  7 11:58:35.523: %BGP_SESSION-5-ADJCHANGE: neighbor 2.2.2.2 VPNv4 Unicast topology base removed from session  BGP Notification received

these are my configuration for both PE Router:
Router 2

router bgp 234
 bgp log-neighbor-changes
 neighbor 4.4.4.4 remote-as 234
 neighbor 4.4.4.4 update-source Loopback0
 !
 address-family ipv4
  no neighbor 4.4.4.4 activate
 exit-address-family
 !
 address-family vpnv4
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
 exit-address-family
 !

ROUTER 4

router bgp 234
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 234
 neighbor 2.2.2.2 update-source Loopback0
 !
 address-family ipv4
  no neighbor 2.2.2.2 activate
 exit-address-family
 !
 address-family vpnv4
  neighbor 2.2.2.2 activate
  neighbor 2.2.2.2 send-community extended
 exit-address-family

What could be the problem? I look everything and I think is all well configured.

Hello Rodrigo

Looking at your configurations, I understand that Router 2 is the PE1 router and Router 4 is the PE2 router in the lesson. Take a look at the configuration that Rene has at the end of the lesson, you will see that some of your VRFs are configured differently, which may result in the error you are getting.

Look it over, try it again and let us know your results!

Laz

Hi,

I have a question that i cannot wrap my head around it. When I BGP between CE and PE, then on PE side, I need to do “neighbor x.x.x.x activate” command under “address-family ipv4 vrf X”. However, if i’m using EIGRP beween CE and PE, then I need to do it under “address-family vrf X as X”. So would you please let me know how do I decide which address family is the right one to use? The other question I have is what is the correlation between a VRF routing table and BGP VPNV4 table on a PE?

Thank you as always for your help,

Hello Helen!

When you use eBGP between the CE and PE routers, then the syntax for the address-family command under the router BGP configuration mode is simply:

address-family ipv4 vrf vrf_name

The syntax used for the address-family command under the router EIGRP configuration mode is:

address-family ipv4 vrf vrf_name autonomous-system X

Note here that the autonomous system that we are referring to is the autonomous system of the EIGRP configuration, not a BGP AS. This is the syntax used when configuring an address-family under the router EIGRP mode. More info on this can be found at this Cisco command reference documentation:

Now you can find an example of the configuration of BGP between PE and CEs at the following lesson:

And the corresponding configuration for EIGRP between PEs and CEs can be found here:

I hope this has been helpful!

Laz

i tried but was not able to ping even after getting routes in the CE router
loopback was present with *> symbol in the vrf of the PE routers
i used lo0 as 1.1.1.1/24 instead of /32 when i redistributed the ospf in BGP it showed a error that 5.5.5.5 may not be reachable and vice versa in PE2
i dont understand why it is not pinging

Hello Anoop

Can you let us know from where and to where you are pinging? Keep in mind that when you verify, you must ping with a source of the loopback. If you simply ping 5.5.5.5 from the CE1 router, you won’t get a response, because the source of that ping is the Fa0/0 interface, which has an IP address of 192.168.12.1. That address is unknown to CE2, so the ping will reach the destination, but there is no route to the original source address.

Make sure you are adding the source loopback 0 keywords after the ping. If it is still not working, give us some more info about your setup so that we can help further with troubleshooting.

I hope this has been helpful!

Laz

image

I hope i uploaded the image screenshot
So let me explain
When i do this command on R2 i get this error

R2(config)#router bgp 20
R2(config-router)# address-family ipv4 vrf Customer
R2(config-router-af)#redistribute ospf 2 vrf Customer 
R2(config-router-af)#
***Mar  1 00:09:05.147: %BGP-4-VPNV4NH_MASK: Nexthop 2.2.2.2 may not be reachable from neigbor 5.5.5.5 - not /32 mask**

But on the other end R5 i get the prefix of R1

R5#sh ip bgp vpnv4 all 
BGP table version is 5, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf CUSTOMER)
*>i1.1.1.1/32       2.2.2.2                 11    100      0 ?
*>i192.168.45.0     2.2.2.2                  0    100      0 ?

These prefixes i redistributed in R2 in BGP from OSPF 2 vrf Customer

I get the same error at other end

**R5(config-router)#**
***Mar  1 00:18:26.935: %BGP-4-VPNV4NH_MASK: Nexthop 5.5.5.5 may not be reachable from neigbor 2.2.2.2 - not /32 mask**

But lets see the routing table at R2 and R5 am i learning the customer routes or not

  1. In bgp vpnv4 table i am getting the routes of customer
R2#sh ip bgp vpnv4 all   
BGP table version is 9, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf Customer)
*> 1.1.1.1/32       192.168.45.1            11         32768 ?
*>i6.6.6.6/32       5.5.5.5                 11    100      0 ?
*> 192.168.45.0     0.0.0.0                  0         32768 ?
*>i192.168.55.0     5.5.5.5                  0    100      0 ?
R5#sh ip bgp vpnv4 all         
BGP table version is 9, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf CUSTOMER)
*>i1.1.1.1/32       2.2.2.2                 11    100      0 ?
*> 6.6.6.6/32       192.168.55.2            11         32768 ?
*>i192.168.45.0     2.2.2.2                  0    100      0 ?
*> 192.168.55.0     0.0.0.0                  0         32768 ?

i am getting the *> symbol which means it should be in routing table but here is the problem
Even after redistributing bgp in ospf still i am getting

R2#sh ip route vrf Customer ospf 

Routing Table: Customer

     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/11] via 192.168.45.1, 00:36:18, FastEthernet0/0

R5#sh ip route vrf CUSTOMER ospf

Routing Table: CUSTOMER

     6.0.0.0/32 is subnetted, 1 subnets
O       6.6.6.6 [110/11] via 192.168.55.2, 00:18:46, FastEthernet0/1

I am not learning the Customer routes here in routing table of PE

But both my customer learns each others route in their routing table

R1#sh ip route 
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
C    192.168.45.0/24 is directly connected, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/21] via 192.168.45.2, 00:03:41, FastEthernet0/0
O IA 192.168.55.0/24 [110/11] via 192.168.45.2, 00:03:41, FastEthernet0/0

R6#sh ip route
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/21] via 192.168.55.1, 00:04:37, FastEthernet0/0
O IA 192.168.45.0/24 [110/11] via 192.168.55.1, 00:04:37, FastEthernet0/0
     6.0.0.0/24 is subnetted, 1 subnets
C       6.6.6.0 is directly connected, Loopback0
C    192.168.55.0/24 is directly connected, FastEthernet0/0

R1#ping 6.6.6.6 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
.....
Success rate is 0 percent (0/5)

R6#ping 1.1.1.1 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 6.6.6.6 
.....
Success rate is 0 percent (0/5)

providing config of R2 and R5 ( PE router)

R2#sh running-config | s ospf
router ospf 2 vrf Customer
 log-adjacency-changes
 redistribute bgp 20 subnets
 network 192.168.45.0 0.0.0.255 area 0
router ospf 1
 log-adjacency-changes
 network 2.2.2.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 0
  redistribute ospf 2 vrf Customer

router bgp 20
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 5.5.5.5 remote-as 20
 neighbor 5.5.5.5 update-source Loopback0
 !
 address-family ipv4
  no neighbor 5.5.5.5 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 5.5.5.5 activate
  neighbor 5.5.5.5 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf Customer
  redistribute ospf 2 vrf Customer
  no synchronization
 exit-address-family


R5#sh running-config | s bgp 
 redistribute bgp 20 subnets
router bgp 20
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 20
 neighbor 2.2.2.2 update-source Loopback0
 !
 address-family ipv4
  no neighbor 2.2.2.2 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 2.2.2.2 activate
  neighbor 2.2.2.2 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf CUSTOMER
  redistribute ospf 2 vrf CUSTOMER
  no synchronization
 exit-address-family

router ospf 2 vrf CUSTOMER
 log-adjacency-changes
 redistribute bgp 20 subnets
 network 192.168.55.0 0.0.0.255 area 0
router ospf 1
 log-adjacency-changes
 network 5.5.5.0 0.0.0.255 area 0
 network 192.168.3.0 0.0.0.255 area 0
  redistribute ospf 2 vrf CUSTOMER

Hello Anoop

The error that you are getting has to do with the way in which OSPF advertises loopback networks. OSPF will always advertise loopbacks as /32 networks, even if you have configured them to be /24. This is how OSPF operates, and it is even defined within RFC 2328. You can see this from the prefixes in the BGP tables on R2 and R5.

If you want to change this behaviour, you can use the ip ospf network point-to-point command under the loopback interface configuration mode. Or you can change the subnet mask on the IP addresses of your loopbacks to eliminate the error.

This error should have no effect on the operation of your MPLS network.

Now the problem you’re facing seems to be coming from your redistribution. Remember, that in the R2 and R5 routers, which are the PE routers in your topology, you have BGP routing, and you have two OSPF processes. You must ensure that redistribution is taking place between the appropriate routing domains. In the lesson, you can see that redistribution is taking place:

  1. from BGP to OSPF process 2
  2. from OSPF process 2 to BGP

In your topology, you are also redistributing OSPF 1 into OSPF 2. I suggest you go over the lab again and ensure that you are adhering to the configurations found there. Try it out and let us know how you come along.

I hope this has been helpful!

Laz

Hi Laz,

Great to know the reason for that eroor

But i have done redistribution properly that may be seen in the above config because of sh run | s command

let me show u the entire running config of R2

interface Loopback0
 ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
 ip vrf forwarding Customer
 ip address 192.168.45.2 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
 mpls ip
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet2/0
 no ip address
 shutdown 
 duplex auto
 speed auto
!
router ospf 2 vrf Customer
 log-adjacency-changes
 redistribute bgp 20 subnets--------------------( redistribute bgp inside ospf 2)
 network 192.168.45.0 0.0.0.255 area 0
!
router ospf 1
 log-adjacency-changes
 network 2.2.2.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 0
!
router bgp 20
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 5.5.5.5 remote-as 20
 neighbor 5.5.5.5 update-source Loopback0
 !
 address-family ipv4
  no neighbor 5.5.5.5 activate
  no auto-summary
  no synchronization
 exit-address-family
 !
 address-family vpnv4
  neighbor 5.5.5.5 activate
  neighbor 5.5.5.5 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf Customer
  redistribute ospf 2 vrf Customer ------------(redistribution of ospf2 in bgp)
  no synchronization
 exit-address-family
!
R2#sh ip route vrf Customer         

Routing Table: Customer
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/11] via 192.168.45.1, 01:45:41, FastEthernet0/0
C    192.168.45.0/24 is directly connected, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
B       6.6.6.6 [200/11] via 5.5.5.5, 01:10:23
B    192.168.55.0/24 [200/0] via 5.5.5.5, 01:10:38
R2#sh ip route os           
R2#sh ip route ospf 
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/31] via 192.168.1.2, 01:45:43, FastEthernet0/1
O    192.168.2.0/24 [110/20] via 192.168.1.2, 01:45:53, FastEthernet0/1
O    192.168.3.0/24 [110/30] via 192.168.1.2, 01:45:53, FastEthernet0/1

Even R1 is learning it

R1#sh ip ospf neighbor            

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.45.2      1   FULL/DR         00:00:37    192.168.45.2    FastEthernet0/0
R1#sh ip route                    
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
C    192.168.45.0/24 is directly connected, FastEthernet0/0
     6.0.0.0/32 is subnetted, 1 subnets
O IA    6.6.6.6 [110/21] via 192.168.45.2, 01:11:27, FastEthernet0/0
O IA 192.168.55.0/24 [110/11] via 192.168.45.2, 01:11:27, FastEthernet0/0

I am stuck here dont know where the issue is

Hello Anoop

The redistribution I was referring to in my previous post where I said:

I was referring to this config:
image
It looks like this was fixed in the config you posted after that.

Looking at the new configs that you sent, I don’t immediately see a problem with the setup. The only thing I see, in comparison with Rene’s configs is that in the redistribution of ospf 2 in BGP you configure:

redistribute ospf 2 vrf Customer

while Rene configures:

redistribute ospf

Rene omits the VRF specification. I haven’t labbed this up, and I’m not completely sure what effect this will have, but it may be worth attempting the change. If not, let us know and we’ll see if we can lab it up too with your configs and help in the troubleshooting process.

I hope this has been helpful!

Laz