cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
491
Views
0
Helpful
2
Replies

Question about network statement in OSPF and BGP

gwhuang5398
Level 2
Level 2

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 10.1.1.0/24 to other BGP peers. I have a OSPF route for this network. I can do 2 things: one is to use "network 10.1.1.0 mask 255.255.255.0", the other is to do "redistribute OSPF ... route-map OSPF-INTO-BGP", and create a prefix list to permit 10.1.1.0/24.

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

Thanks a lot

Gary

2 Replies 2

pkhatri
Level 11
Level 11

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.

Paresh

Hi,

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...

Paresh

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: