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

Pete S. pshuleski at gmail.com
Wed May 30 17:27:41 EDT 2007


for OSPF to prefer sending traffic to R2....

on R1:
router ospf <proc ID>
default-information originate metric-type 1 metric 200

on R2:
router ospf <proc ID>
default-information originate metric-type 1

This should make all non-local traffic prefer R2. But it won't provide
dynamic failover in case of external peer failure.

If R1 could handle the full table it would be easy...
---------------------------------------------------------------------------
issue 'default-information originate metric-type 1' to announce a
default route to r1 and r2 via ospf.  non-local traffic on your
network should now make it up to r1 or r2.

Create an iBGP peer between r1 and r2.
This will share the default route with R2(which currently had none)

R2 will now have specifics and a default route.  And R1 will have
specifics out R2, and a default route.   Since you have a full table,
all internet sites should be known and traffic will leave R2 to its
eBGP peers.

Any non-local, unknown internet traffic will find its way out of R1's default.
======================================

Since r1 can't hand a full table...a more complicated/flawed version...
------------------------------------------------------------------------------------------
issue 'default-information originate metric-type 1' to announce a
default route to r1 and r2 via ospf.  non-local traffic on your
network should now make it up to r1 or r2.

Create an iBGP peer between r1 and r2.
On r2 use
neighbor <r1's IP>  default-originate.
Permit only the default towards r1(on R2), or only the default coming
into r1 from R2 using prefix-lists and route-maps.

R1 will now have 2 default routes.  Set a higher local pref on the
default coming from r2.
Now non-local traffic that reaches R1 will get sent to R2, and leave
through its peers, or be unreachable if an unknown route.

A failure of R2, will result in traffic leaving R1 through its eBGP
default.  A failure of R2 peers, will require you to remove R2's
neighbor <r1 ip> default originate or you'll have a loop.
==============================================

My recommendation:
get a new r1, and a full feed.  or ask your peer(s) on r2 to give you
a default route.

Issue 'default-information originate metric-type 1' to announce a
default route to r1 and r2 via ospf.  non-local traffic on your
network should now make it up to r1 or r2.

A default BGP route from peers on r2, and iBGP peering between r1 and
r2(again filter all but the default on r1 from r2) would let you set a
higher local pref on the default from R2 peer.  R1 would send to R2
because of local pref, and you would have dynamic fail over for the
default route.  Traffic will prefer the smaller routes in the full
feed on R2.  Unknown non-local would still exit r2's external peer.
A failure of r2, would send traffic out r1.  A peer failure on r2,
would also send traffic out R1(r2 would know about r1's default).  An
R1 failure would not impact anything getting sent out(ospf should
completely failover to r2)

Hope this wasn't too confusing, and sends you in the right direction.

--Pete

On 5/30/07, Mark Kent <mark at noc.mainstreet.net> wrote:
> 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
> _______________________________________________
> cisco-nsp mailing list  cisco-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/
>


More information about the cisco-nsp mailing list