I have seen in forums and in other places that some find that the
default route in BGP is a bit confusing. There are multiple ways of
orginating a default route in BGP. To start this is the topology
used:

Default

The following configurations are there from the start:

R1

R2

R3

R4

R2 is learning the loopbacks from R3 and R4. R2 has a default route towards R1.
The goal is to announce default route in BGP. Redistribute static should be
enough to announce the default route?

We are not seeing it being advertised to the peers…

Is it in the BGP RIB of R2?

It is not. BGP does not redistribute a static default route unless the
default-information command is used. This protects against someone accidentally
redistributing a default route in BGP which could potentially be disastrous.

Now the default route is spread. If we receive a default route in OSPF that
can be redistributed as well. Don’t forget to match externals or you will
have a facepalm moment like I did while writing this post.

There is now a default route learned via OSPF.

Now to redistribute OSPF into BGP.

So the default-information originate command must always be accompanied by
a redistribute statement. It can be static or from a dynamic protocol but
there must be a redistribute statement.

It is also possible to use the network command.

The difference here is that network 0.0.0.0 will pick it up if there is
a default route in the RIB. There is no need to redistribute. Now for OSPF
as well.

What if we don’t want to use a default route on the local router or only
generate a default route towards a specific neighbor. That is when the
default-originate command is used towards a neighbor.

As you can see. There is no default route in R2 RIB or BGP RIB. R3 should not
have a default route now.

R4 has it.

So to summarize. When advertising a default route in BGP you can either use
network 0.0.0.0 command. This can be used to only inject a default without
redistributing static or dynamically learned routes.

The default-information originate command is used if you are redistributing
routes but the default route is not getting included. This command must always
be matched by a redistribute statement.

Default-originate is used to only advertise a default to a specific neighbor
and it does not insert default route into BGP RIB and does not regquire a
default to exist in RIB at all.

The last command would probably be the only one used in a real life case but
for the CCIE lab you need to know them all.

Default routes in BGP

6 thoughts on “Default routes in BGP

  • October 4, 2013 at 12:21 pm
    Permalink

    Daniel,
    like what you are doing with the blog, am using it as a direction pointer! With R3 i-bgp session, there is a next-hop issue, for both the default and R4 static.

    Reply
  • November 21, 2014 at 5:46 pm
    Permalink

    Daniel, thanks for taking the time to post this. It helped me figure out why my configuration wasn’t working.

    Reply
  • December 16, 2014 at 11:22 am
    Permalink

    Thanks for the simple and easy understandable explanation.
    We can add one more thing to it.
    Conditional Default route advertisement for particular neighbor. Lets says R3 should receive default route only if R2 has 1.0.0.0 network in its RIB

    Access-list 1 permt 1.0.0.0

    Route-map abc permit 10
    match ip address 1
    exit

    router bgp 2
    neighbor 23.23.23.3 default-originate route-map abc.

    Reply
  • February 25, 2016 at 11:06 am
    Permalink

    Regarding the redistribution from OSPF, I had the same facepalm as you, but reversed.

    In our conf we had a redistribute ospf 1 route-map o2b, so I thought that the default will not be included as it was E2. Apparently the route map takes precedence, even if external routes should not be allowed.

    So no need to include external if you use a route-map (which I believe should be always the case to avoid funky behavior.)

    Reply
  • November 21, 2016 at 6:23 am
    Permalink

    It was a very clear explanation with example. Thank you.

    Reply

Leave a Reply

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

%d bloggers like this: