Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
Community Member

Question about network statement in OSPF and BGP

The network statements in OSPF and BGP can be used to advertise networks. But I'm not clear under what circumstances would make more sense to use network statements to advertise a network than by using other methods to have the network learned by other routers.

Here is an example: assume I'm running BGP on router A. I want to advertise network to other BGP peers. I have a OSPF route for this network. I can do 2 things: one is to use "network mask", the other is to do "redistribute OSPF ... route-map OSPF-INTO-BGP", and create a prefix list to permit

Both would work to have this network learned by other BGP peers. But which is better for what purpose?

Thanks a lot



Re: Question about network statement in OSPF and BGP

Hi Gary,

There is one little difference between the use of the two approaches - the route injected into BGP by using a network statement will carry an Origin attribute of IGP, whereas the route injected using redistribution will have an Origin attribute of Incomplete. Now, that is not a huge issue since you can always change that whatever value you desire both with the use of the network statement and redistribution. The important thing, however, is that in the BGP best path selection process, the Origin attribute comparison is fairly high up and will prefer a route with the attribute of IGP.

Apart from that, there is absolutely no difference between using the network statement and using redistribution with a route-map that matches exactly on the same route that you would have specified with the network statement.

I guess one advantage of using the redistribute approach is that it does not clutter up the BGP config. If you wish to add more routes, you simply add them to the prefix list so that you don't really touch the BGP config portion at all..

Hope that helps - pls do remember to rate posts that help.



Re: Question about network statement in OSPF and BGP


There is one other point. There is always a danger when redistributing routes that you may inadvertently advertise more routes than you need. For example, suppose that someone mistakenly removed the prefix-list that you were using in your route-map. That will result in all routes from the OSPF process being injected into BGP. This would obviously cause some umpleasant issues...


CreatePlease to create content