MPLS VPN PE-CE OSPF Default Route

Lesson Contents

When you try to advertise a default route from one CE router to another CE router in an MPLS VPN PE-CE OSPF topology, you might be disappointed that it doesn’t show up on the other end. There are some additional commands we have to add before our PE routers advertise a default route.

In this lesson, I’ll explain how to advertise that default route. I’ll also show you which show commands to use to check your CE and PE routers. Let’s get started!

Configuration

Below is the topology we are going to use:

mpls vpn pe ce ospf gigabit

This is the same topology I used in the MPLS VPN PE-CE OSPF lesson.

Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

CE1

hostname CE1
!
ip cef
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.12.1 255.255.255.0
!
router ospf 1
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.12.0 0.0.0.255 area 0
!
 login
!
end

CE2

hostname CE2
!
ip cef
!
interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.45.5 255.255.255.0
!
router ospf 1
 network 5.5.5.5 0.0.0.0 area 0
 network 192.168.45.0 0.0.0.255 area 0
!
end

P

hostname P
!
ip cef
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.23.3 255.255.255.0
 mpls ip
!
interface GigabitEthernet0/2
 ip address 192.168.34.3 255.255.255.0
 mpls ip
!
router ospf 1
 network 3.3.3.3 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
end

PE1

hostname PE1
!
ip vrf CUSTOMER
 rd 1:1
 route-target export 1:1
 route-target import 1:1
!
ip cef
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/1
 ip vrf forwarding CUSTOMER
 ip address 192.168.12.2 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 192.168.23.2 255.255.255.0
!
router ospf 2 vrf CUSTOMER
 redistribute bgp 234 subnets
 network 192.168.12.0 0.0.0.255 area 0
!
router ospf 1
 mpls ldp autoconfig
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
router bgp 234
 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
 !
 address-family ipv4 vrf CUSTOMER
  redistribute ospf 2
 exit-address-family
!
end

PE2

hostname PE2
!
ip vrf CUSTOMER
 rd 1:1
 route-target export 1:1
 route-target import 1:1
!
ip cef
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface GigabitEthernet0/1
 ip vrf forwarding CUSTOMER
 ip address 192.168.45.4 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 192.168.34.4 255.255.255.0
!
router ospf 2 vrf CUSTOMER
 redistribute bgp 234 subnets
 network 192.168.45.0 0.0.0.255 area 0
!
router ospf 1
 mpls ldp autoconfig
 network 4.4.4.4 0.0.0.0 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
router bgp 234
 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
 !
 address-family ipv4 vrf CUSTOMER
  redistribute ospf 2
 exit-address-family
!
end





We advertise a default route on CE1:

CE1(config)#router ospf 1
CE1(config-router)#default-information originate always

This default route doesn’t show up on CE2:

CE2#show ip route ospf

      1.0.0.0/32 is subnetted, 1 subnets
O IA     1.1.1.1 [110/3] via 192.168.45.4, 00:27:34, GigabitEthernet0/1
O IA  192.168.12.0/24 [110/2] via 192.168.45.4, 00:27:34, GigabitEthernet0/1

Let’s find out what is going on. PE1 has it in its routing table:

PE1#show ip route vrf CUSTOMER | include 0.0.0.0/0
O*E2  0.0.0.0/0 [110/1] via 192.168.12.1, 00:10:02, GigabitEthernet0/1

However, it’s not in the BGP table:

PE1#show ip bgp vpnv4 vrf CUSTOMER

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

The default route doesn’t show up because, by default, the redistribute ospf BGP command doesn’t redistribute OSPF external routes. Here’s what our configuration looks like on PE1:

PE1#show run | begin router bgp
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
 !
 address-family ipv4 vrf CUSTOMER
  redistribute ospf 2
 exit-address-family

Let’s change the redistribute command so that OSPF external routes are also redistributed into BGP:

PE1(config)#router bgp 234
PE1(config-router)#address-family ipv4 vrf CUSTOMER
PE1(config-router-af)#redistribute ospf 2 match internal external

Does this fix our problem? Let’s check:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 799 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

560 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags: ,


Forum Replies

  1. Two questions inspired by this lessons that maybe strictly speaking deserve its own lesson in BGP course:

    1. Rules for redistribution of default route into BGP - if it is from OSPF we need to explicitly inform BGP we want internal and external routes. From static routes it works straightforward. And maybe also from EIGRP (?). But thats not enough - we also need to confirm we want default that was distributed to be advertised by BGP. One way is to run default-information originate (and BGP does not have ‘always’ keyword, thats it will not advertise unless route i
    ... Continue reading in our forum

  2. Hello Vadim

    Concerning point 1, indeed the network 0.0.0.0 and the default-information originate commands deliver similar results in that they will inject the default route into the BGP RIB, and it will be advertised to all BGP neighbors. The difference is in the origin of the default route. In each case, the default route comes from a different source.

    With default-information originate, the default route is artificially generated and injected into the BGP RIB. A redistribution statement must also be configured to complete this configuration or the default

    ... Continue reading in our forum

  3. Thanks, Laz, seems finally I got it (till the next 4 years later when I forget it all). After doing in lab all possible scenarios I can seems discard all the contradictory Internet explanations that people provide while still confused with this matter :-). It actually sticks with laconic CISCO command reference and can be stated as:
    ‘network 0.0.0.0’ forces BGP to advertise EXISTING in RIB (no matter how it got into RIB) default to all neighbors in address-family and treat it as originated by BGP locally (where network command is entered) route;
    ‘default-infor

    ... Continue reading in our forum

  4. Hello Vadim

    Yep, it looks like you’ve explained it very clearly here. Especially true is what you’ve said here…

    Labbing things up and experiencing how they work is one of the most useful ways of learning, and that’s great that you’ve done this.

    I hope this has been helpful!

    Laz

  5. this is the best explanation for the command
    redistribute ospf 2 match internal external & default-information originate
    no matter which material i used to understand it i couldn’t till i saw this lesson
    amazing

5 more replies! Ask a question or join the discussion by visiting our Community Forum