cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
116489
Views
66
Helpful
19
Replies

Difference between Default-originate and network 0.0.0.0 in BGP

turbo_engine26
Level 4
Level 4

Hello,

 

Please i need someone to clarify what is the difference between the

"default-originate" command and "network 0.0.0.0 - ip route 0.0.0.0 0.0.0.0 null0" commands. 

I see both are serving the same purpose by advertising a default route to a peer but in the same time i feel a difference on them.

 

Thx

 

Regards,

A.M.

2 Accepted Solutions

Accepted Solutions

Dear friends,

 

Subramaniya has summed up the options of injecting the default route into BGP very nicely. Thank you!

 

In addition, let me point out a couple of differences in these approaches.

 

The default-information originate

redistribution from a different source, and

network 0.0.0.0

are all similar in the resulting effect: they will inject the default route into BGP RIB and it will be advertised to all BGP neighbors. The difference is in the origin of the default route that is injected into BGP:

 

  • default-information originate
    causes the default route to be artificially generated and injected into the BGP RIB, regardlessly of whether it is present in the routing table.
  • Redistribution and
    network 0.0.0.0
    will inject the default route into BGP only if the default route is currently present in the routing table, and additionally in the case of redistribution, if learned by a specific source protocol we are redistributing from.

 

The

neighbor X.X.X.X default-originate

is different in that the default route will be advertised only to this specific BGP neighbor and not to all existing BGP neighbors as with the previous approaches. The default route will not be present in the BGP RIB of the router that is configured with the

neighbor X.X.X.X default-originate

command and so it won't be generally advertised to all BGP neighbors. At the same time, this command is similar to the

default-information originate

in that the default route is artificially generated and does not need to be present in the routing table.

 

Subramaniya, let me correct a small inaccuracy: you wrote:

 

The "network 0.0.0.0" command enables the router to advertise the default route because the router thinks that 0.0.0.0 is directly connected via Null0.

 

With respect to BGP, the

network

command is not searching for directly connected networks (as opposed to IGP protocols) but for networks present in the routing table. They do not need to be directly connected. Correctly, the statement should say:

 

The network 0.0.0.0

command enables the router to advertise the default route because the router has the 0.0.0.0/0 route present in its routing table.

 

Best regards,

Peter

View solution in original post

Hello,

But i still didn't get why we use Null0 .... As the books says, it is  used because if a traffic didn't match a more-specific routes matches  the default route, it will be dropped. I didn't get this one as normally  we use a default route because if a traffic didn't match a more  specific-route and matches the default route, it should be forwarded not  dropped, right?

Well, it depends on whether there actually is a way to forward such packets further at all. If you are a stub AS, i.e. you have one or more ISPs but you are not carrying transit traffic, then by all means, the default route should not point to Null0 but rather to correct peers in neighboring AS-es so that your AS can reach the outside world.

But if you are an AS that is a part of the internet backbone itself, there is no such thing as a "default route". You cannot go anywhere "higher". If a route is not known here, it does not exist at all. In these cases, if you still need for whatever reasons to advertise a default route, you do not have any source to learn it from, so you simply do that trick with the Null0 route and advertise it in BGP. However, if the packets to unknown destination eventually make it to your router, they still must be either router by some more specific route, or they are destined to a non-existent network and must be dropped so-or-so. In these cases, the Null0 route does exactly what it is supposed to do.

Best regards,

Peter

View solution in original post

19 Replies 19

Mahesh Gohil
Level 7
Level 7

Hi A.M,

 

Based on my experience

default-originate

doesn't require the presence of default route in routing table while advt. via.

network

. command need default static route to be present in routing table.

 

So how it is different, I don't see any difference.

 

But I faced problem when customer was connected to two ISP ..one advt. default-route via

default-originate

and other propogating default as it is coming from their upstream. In later case the As-Path was longer and it was creating problem at customer end for path selection and customer specifically asked us to propogate it via. default-route so that he can see my default-route with single AS-PATH...

 

Hope this helpful

 

Regards

Mahesh

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

 

Are you asking about

"neighbor X.X.X.X default-originate" or "default-information originate"

command in BGP configuration?

 

Best regards,

Peter

Hello Peter,

 

I am asking the difference between thte below command lines:

 

router bgp 200

network 0.0.0.0

!

!

ip default route 0.0.0.0 0.0.0.0 null0




And




router bgp 200

neighbor 1.1.1.2 default-originate


 

 

Regards,

A.M.

Basically there are three variants of default route advertisements

 

1) The command

neighbor default-originate

advertises a default route irrespective of whether the route is present in Routing table/BGP table or not.

 

2)

 router bgp 200

    network 0.0.0.0

    !

    !

    ip route 0.0.0.0 0.0.0.0 null0 The network 0.0.0.0

 

command enables the router to advertise the default route because the router thinks that 0.0.0.0

is directly connected via Null0.

 

This just injects the default route into BGP.

 

3) Redistribution from other protocols

 

While the default route is redistributed into BGP from other protocols, you would also need to configure the command

default-information originate

command inside the BGP process.

 

Please note that in case 2 we are not really redistributing and hence would not need the

default-info originate

command in the BGP process.

 

Hope that Helps.

Thanks.

Dear friends,

 

Subramaniya has summed up the options of injecting the default route into BGP very nicely. Thank you!

 

In addition, let me point out a couple of differences in these approaches.

 

The default-information originate

redistribution from a different source, and

network 0.0.0.0

are all similar in the resulting effect: they will inject the default route into BGP RIB and it will be advertised to all BGP neighbors. The difference is in the origin of the default route that is injected into BGP:

 

  • default-information originate
    causes the default route to be artificially generated and injected into the BGP RIB, regardlessly of whether it is present in the routing table.
  • Redistribution and
    network 0.0.0.0
    will inject the default route into BGP only if the default route is currently present in the routing table, and additionally in the case of redistribution, if learned by a specific source protocol we are redistributing from.

 

The

neighbor X.X.X.X default-originate

is different in that the default route will be advertised only to this specific BGP neighbor and not to all existing BGP neighbors as with the previous approaches. The default route will not be present in the BGP RIB of the router that is configured with the

neighbor X.X.X.X default-originate

command and so it won't be generally advertised to all BGP neighbors. At the same time, this command is similar to the

default-information originate

in that the default route is artificially generated and does not need to be present in the routing table.

 

Subramaniya, let me correct a small inaccuracy: you wrote:

 

The "network 0.0.0.0" command enables the router to advertise the default route because the router thinks that 0.0.0.0 is directly connected via Null0.

 

With respect to BGP, the

network

command is not searching for directly connected networks (as opposed to IGP protocols) but for networks present in the routing table. They do not need to be directly connected. Correctly, the statement should say:

 

The network 0.0.0.0

command enables the router to advertise the default route because the router has the 0.0.0.0/0 route present in its routing table.

 

Best regards,

Peter

Hi Peter,

 

Believe it or not! I understood the entire topic when you said the word "Artifically", i liked the word. This is a very correct keyword to call the

default-originate

command. It's something the router makes by its hands like a baker who passes a bread to his neighbor regardless if his neighbor already got a bread or not. On the other hand, network statement in BGP is used to advertise networks and these networks should exist in the routing table in the first place, that's why default route should also exist in the routing table.

 

This is excellent explanation Peter , thx.

 

But i still didn't get why we use Null0 .... As the books says, it is used because if a traffic didn't match a more-specific routes matches the default route, it will be dropped. I didn't get this one as normally we use a default route because if a traffic didn't match a more specific-route and matches the default route, it should be forwarded not dropped, right?

 

 

 

Regards,

A.M.

Hello,

But i still didn't get why we use Null0 .... As the books says, it is  used because if a traffic didn't match a more-specific routes matches  the default route, it will be dropped. I didn't get this one as normally  we use a default route because if a traffic didn't match a more  specific-route and matches the default route, it should be forwarded not  dropped, right?

Well, it depends on whether there actually is a way to forward such packets further at all. If you are a stub AS, i.e. you have one or more ISPs but you are not carrying transit traffic, then by all means, the default route should not point to Null0 but rather to correct peers in neighboring AS-es so that your AS can reach the outside world.

But if you are an AS that is a part of the internet backbone itself, there is no such thing as a "default route". You cannot go anywhere "higher". If a route is not known here, it does not exist at all. In these cases, if you still need for whatever reasons to advertise a default route, you do not have any source to learn it from, so you simply do that trick with the Null0 route and advertise it in BGP. However, if the packets to unknown destination eventually make it to your router, they still must be either router by some more specific route, or they are destined to a non-existent network and must be dropped so-or-so. In these cases, the Null0 route does exactly what it is supposed to do.

Best regards,

Peter

Aha! got it ... Thx a lot

 

Personal question:

 

Is it okay to ask freely as many questions as i need? ... The thing is, i do the practicing in each case study but of course i face some issues so i must ask questions about them. Also, troubleshooting is very important for me so sometimes my questions not about concepts only but about behaviors. For example, output of

sh ip bgp

shows a strange output.

 

Please let me know your feedback.

 

 

Regards,

A.M.

Hello my friend,

Sure, you are welcome to freely ask as many questions as you wish. This is exactly the reason why these forums are here. There will always be somebody around to answer your queries, including myself.

Please do continue asking your questions. The thing to watch for is to keep the thread topic focused, and if a different, unrelated issue arises, create a new thread for it. Your questions - and their solutions - may be interesting to many people, and having them under separate and appropriately named threads greatly helps others to find them.

Best regards,

Peter

Thx a lot Peter

Hi,

I have read and tried to digest the implications of the subject of this thread to my own situation and I would ask if someone could confirm my understanding. Firstly, my situation is - I currently receive a Default Route from my IP Transit Provider (in preference to the entire Global Routing Table, which will completely use the available router memory I have available for the present). Out of necessity, I am considering using this same router to connect to a local Peering Exchange and understand that I must not advertise my Default Route to my eBGP peers on the exchange. Is there a way to utilise the

neighbor X.X.X.X default-originate

command to allow the advertising of the default route to a defined network thus ensuring I comply with proper peering behavior of not advertising to other BGP neighbors on the Peering Exchange? Appreciate any guidance!

 

Thanks

Craig  

Hi,



Thanks for the information, but i still have a little doubt, what is the difference between

default-information originate and default-information originate always ???

@Peter Paluch

I know this is and old thread, but just wanted to confirm,

default-information originate

causes the default route to be artificially generated and injected into the BGP RIB, regardlessly of whether it is present in the routing table."

 

Doesn't this as a general command also requires to have default in the RIB, except for

#nieghbor x.x.x.x default-originate

which will create artificial default route in BGP RIB regardless of weather its present in RIB or not?

 

thanks

 

Hello,

 

router bgp 1

default-information originate

 

--> requires a static route to be present in the RIB and to be statically redistributed into BGP

 

router bgp 1

neighbor 192.168.1.2 default-originate

 

--> advertises a default route to the peer, regardless if it is in the RIB

Review Cisco Networking products for a $25 gift card