[c-nsp] ospf, bgp, and 0.0.0.0/0

Mark Kent mark at noc.mainstreet.net
Wed May 30 16:04:18 EDT 2007


I've got this situation:

  [upstream1]<-->[r1]<-->[r2]<-->[upstream2],[3],[4]

r1 and r2 are mine.  All connections are lan (fastE and gigE).
upstream1 is a backup, it sends me only it's own routes and a default
route via bgp.  No other provider sends me a default route via bgp,
but they do send full routes.

I don't want to send r1 the full bgp table because it gets
bogged down cpu-wise.    I want it to default to r2.

Via ospf, r2 originates the default route to r1.
But on r1 the default route learned via bgp from upstream1
wins out.   I want the ospf default route from r2 to win.

The bgp entry has these attributes:

Routing entry for 0.0.0.0/0, supernet
  Known via "bgp 65534", distance 20, metric 0, candidate default path
  Tag 65535, type external
  Last update from 172.16.16.97 00:02:49 ago
  Routing Descriptor Blocks:
  * 172.16.16.97, from 172.16.16.97, 00:02:49 ago
      Route metric is 0, traffic share count is 1
      AS Hops 1, BGP network version 0
      Route tag 65535

and when I suppress the bgp default route, this is what I 
see for the ospf entry:

Routing entry for 0.0.0.0/0, supernet
  Known via "ospf 2", distance 110, metric 1, candidate default path
  Tag 2, type extern 2, forward metric 1
  Last update from 192.0.2.76 on FastEthernet6/0, 00:00:51 ago
  Routing Descriptor Blocks:
  * 192.0.2.76, from 192.0.2.76, 00:00:51 ago, via FastEthernet6/0
      Route metric is 1, traffic share count is 1
      Route tag 2

I jacked up the metric on the bgp route to 200, but it didn't
make a difference.

What do I need to do to get the ospf route preferred over the 
one learned via bgp?

Thanks,
-mark


More information about the cisco-nsp mailing list