left_cls_iimg

OSPF and BGP Puzzle

I love interesting problems that we face when studying for our CCIEs. Especially fun are those that come from an unusual behavior of protocols.

Couple of days ago, a student sent me this little problem. It looks simple, but let’s see how you do solving it.

Diagram

The setup is really straight-forward. Routers R2 and R5 are running OSPF in area 0. Router R2 has two static routes pointing to Null0 interface (0.0.0.0/0 and 10.0.0.0/8). This is the task:

  • Redistribute only 0.0.0.0/0 into OSPF on R2
  • Make sure the default route is received in OSPF on R5 and advertised in BGP to R4

Here is the relevant configuration on all three routers.

R2:

hostname R2
!
interface Loopback0
 ip address 192.168.0.2 255.255.255.255
!
interface Serial0/2/0
 ip address 192.168.25.2 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 Null0
ip route 10.0.0.0 255.0.0.0 Null0
!
ip prefix-list Redistribute seq 10 permit 0.0.0.0/0
!
route-map Connected permit 10
 match ip address prefix-list Redistribute
!
router ospf 1
 router-id 192.168.0.2
 network 192.168.0.0 0.0.255.255 area 0
 redistribute static subnets route-map Connected
!

R5:

hostname R5
!
interface Loopback0
 ip address 192.168.0.5 255.255.255.255
!
interface Serial0/0/0
 ip address 172.16.45.5 255.255.255.0
!
interface Serial0/2/0
 ip address 192.168.25.5 255.255.255.0
!
router ospf 1
 router-id 192.168.0.5
 network 192.168.0.0 0.0.255.255 area 0
!
router bgp 5
 bgp router-id 192.168.0.5
 neighbor 172.16.45.4 remote-as 4
 redistribute ospf 1
!

R4:

hostname R4
!
interface Loopback0
 ip address 172.16.0.4 255.255.255.255
!
interface Serial0/1/0
 ip address 172.16.45.4 255.255.255.0
!
router bgp 4
 bgp router-id 172.16.0.4
 neighbor 172.16.45.5 remote-as 5
!

We can see that both OSPF and BGP are operational:

R5:

R5#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.2       0   FULL/  -        00:00:34    192.168.25.2    Serial0/2/0

R5#show ip bgp summary | begin ^Neighbor
Neighbor        V          AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.45.4     4          4      31      33        4    0    0 00:29:56        0

However, not everything works as expected. Take a look at the OSPF routes on R5:

R5:

R5#show ip route ospf
     192.168.0.0/32 is subnetted, 2 subnets
O       192.168.0.2 [110/65] via 192.168.25.2, 00:31:28, Serial0/2/0

Also, let’s take a look at the BGP routes on R4:

R4:

R4#show ip route bgp
B    192.168.25.0/24 [20/0] via 172.16.45.5, 00:30:00
     192.168.0.0/32 is subnetted, 2 subnets
B       192.168.0.2 [20/65] via 172.16.45.5, 00:30:00
B       192.168.0.5 [20/0] via 172.16.45.5, 00:30:00

We can clearly see that the default route is missing on both R5 and R4. What’s wrong and how do we fix this problem? Post your thoughts and solutions in the comments below and in a few days, I’ll follow-up with the solution.

Happy studies!


Marko Milivojevic – CCIE #18427
Senior CCIE Instructor – IPexpert
Join our Online Study List

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>