cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1180
Views
15
Helpful
10
Replies

OSPF and BGP

hassan_syed6
Level 1
Level 1

Router # 1 = Asia- Running OSPF/BGP

Router # 2 = Asia - Running OSPF/BGP

Router # 3 = Asia - Running OSPF/BGP

Router # 4 = Asia- Running OSPF/BGP

Router # 5 = US running BGP

Router # 6 = US- Running BGP

Router # 7 = US-Running BGP

Router # 8 = US-Running BGP

Router # 1 and Router # 2 which are in ASIA both are running OSPF between them. Each Router Router # 1 and Router # 2 also

are connected to Router # 5 and Router # 6 in US with BGP running between them. ( Router # 1 ---BGP---- Router # 5) and ( Router # 2----BGP---Router # 6).

Router # 1 and Router # 2 both have Route-maps which sends the routes to Router # 5 and Router # 6 and vice versa.

Router # 1 and Router # 2 also are connected to Router # 3 and Router # 4 in Asia and routing is done through OSPF. What ever Router # 1 and Router # 2 gets from US-Routers ( Router # 5 and Router # 6) through BGP it injects those BGP routes into OSPF and sends it to Router # 3 and Router # 4.

Now this is what we are trying to acheive.

What ever Router # 5 and Router # 6 sends to Router # 1 and Router # 2 through BGP. We wanted to change the routing and have Router # 5 and Router # 6 send all those routes to Router # 7 and Router # 8 in US through BGP.

We will have Router # 3 and Router # 4 will have a connection to Router # 6 and Router # 7 through BGP and will learn all those routes which were initially send to Router # 1 and Router # 2 from US router ( Router # 5 and 6).

Now Router # 3 and Router # 4 will send those learned BGP routes and will inject them into OSPF through route-map so it can send to Router # 1 and Router # 2 which are connected to Router # 3 and Router # 4 through OSPF.

We want to discontinue the connection between Router # 1 to Router # 5 ( BGP) and Router # 2 to Router # 6 (BGP) and we now want to send all traffic from Router # 3 and Router # 4.

So I have two options...want your input whether which option is good.

Either i put "network statements" under BGP on Router # 3 and Router # 4 for all the networks which Router # 1 and Router # 2 sends to Router # 5 and 6. Because Router # 1 and Router # 2 send these routes to Router # 3 and Router # 4 through OSPF. Now when we discontinue the connection between Router # 1 and Router # 2 to Router # 5 and Router # 6. We still wants to learn and send all these routes through new connection which will be between Router # 3 and Router # 4 and Router # 7 and Router # 8. But Router # 1 and Router # 2 connection to Router # 3 and Router # 4 has only OSPF connection.

So should i create and route map and inject all OSPF routes into BGP and then send it through or create network statements and then send it through to the new connection.

I am very very very sorry...for this Long explanation...I tried my best to simplify it.

If some of you understand what i am trying to acheive let me know i will explain...if needed to clearify.

Regards,

Hassan.

2 Accepted Solutions

Accepted Solutions

Hassan,

BGP will insert a network 10.10.10.0/24 into the BGP table with the statement "network 10.10.10.0 mask 255.255.255.0", IF 10.10.10.0/24 is found in the IP routing table.

So with respect to this, there is no difference to the redistribution from OSPF filtered by a route-map.

Both methods will give you the same result with respect to connectivity.

You are right, when it comes to announcing many networks, redistribution with route-maps can be simpler from a configuration point of view.

Regards, Martin

View solution in original post

For any network to be advertised via BGP using the 'network' command a matching route has to exist in the routing table. Let's say you have 10.10.10.1/32 & 10.10.10.2/32 in the routing table but no 10.10.10.0/24 route then BGP wouldn't advertise 10.10.10.0/24.

You can workaround this by adding a static route pointing to null 0 'ip route 10.10.10.0 255.255.255.0 null 0' and advertise 10.10.10.0/24 using 'network' statement under BGP process if that's what you want. Instead, if you want to advertise ONLY the host routes then you need to include two network statments like this one and you wouldn't need a static route as you already have it in the routing table.

route bgp xxx

network 10.10.10.1 mask 255.255.255.255

network 10.10.10.2 mask 255.255.255.255

HTH

Sundar

View solution in original post

10 Replies 10

mheusinger
Level 10
Level 10

Hello Hassan,

what you are asking is imho - even more simplified - should networks be redistributed or announced through network statements in BGP. Is this correct?

If this is correct, then it would depend on the number of routes to be announced.

redistribution can be setup to support any number of networks. On the other hand there might be routing loops if filters are not designed properly. Another advantage will be BGP path selection prefering the path through the lowest MED, which will be OSPF cost.

In case you use network statements, routing loops are less likely, but with an increasing number of networks or frequent changes configuration can become a burden.

Other than that both options will give you connectivity.

Are there any other requirements than getting connectivity - and redundancy?

Regards, Martin

Hello Martin,

Thanks for the reply. I have found out if you use "network statements" under BGP then there is a Limit of "200". Also if I use route-maps and define which networks I wanted to inject into BGP from OSPF, then it will be alot easier. If routing loops occur for a Particular network then you can always check the route-map for that specific network.

This limitation of "network statements" of 200 is I am concerned with. Also in Network statements in BGP if you have to define a specific network which you want to advertise in BGP. Eg, let's say there are two BGP customers one wants to learn about a OSPF network " 10.10.10.1/24) and the other customer wants to access something like 10.10.10.2/24 then you have to define both of them as network statement. You cannot put " network 10.10.10.0 mask 255.255.255.0". You will have to define 2 network statements in BGP. One would be " network 10.10.10.1 mask 255.255.255.0 and the other one would be network 10.10.10.2 mask 255.255.255.0.

Correct me if i am wrong.

If you use route-maps to inject OSPF routes in BGP. then in redistribution of OSPF into BGP route-map we can simplay say " permit 10.10.10.0 0.0.0.255" and then once this 10.10.10.0/24 is injected into BGP then we can forward this /24 to both customers.

Please correct me if i am wrong.

Thanks,

Hassan

Hassan,

BGP will insert a network 10.10.10.0/24 into the BGP table with the statement "network 10.10.10.0 mask 255.255.255.0", IF 10.10.10.0/24 is found in the IP routing table.

So with respect to this, there is no difference to the redistribution from OSPF filtered by a route-map.

Both methods will give you the same result with respect to connectivity.

You are right, when it comes to announcing many networks, redistribution with route-maps can be simpler from a configuration point of view.

Regards, Martin

Hello Martin,

A quick question so that i am a little clear.

Two BGP customers wants to access OSPF network say as I mentioned earlier 10.10.10.1/24 and 10.10.10.2/24. Now in a Router which are getting these OSPF routes and wants to inject into BGP. When i announce it to the BGP customer in "network statements" I have to define two "network statements" under bgp right, network 10.10.10.1 mask 255.255.255.0 and 10.10.10.2 mask 255.255.255.0. Correct me if i am wrong.

If i put under BGP network statements " network 10.10.10.0 mask 255.255.255.0 then if two BGP customers wants to access .1 and .2 respectively won't get it. Please let me know..

Thanks,

Hassan...

Hassan,

The networks 10.10.10.1/24 and 10.10.10.2/24 are part of the same common subnet 10.10.10.0/24.

So if you advertise this route then both BGP customers should receive it.

If your requirement is to specifically allow only the host networks 10.10.10.1 & 10.10.10.2 and not the entire subnet, then you will have to change the statements to

network 10.10.10.1 mask 255.255.255.255

make sure you have the exact host route above in the routing table for BGP to advertise

HTH, rate if it does

Narayan

Hello,

I know that 10.10.10.0/24 covers both the host addresses (10.10.10.1 and .2/24). The following is where i am getting very confuse.

Let's say Host's in OSPF is 10.10.10.1/24 and 10.10.10.2/24. Now my BGP customers wants to access the above hosts. Now this is what i am trying to understand.

What if i put in my BGP network statements " network 10.10.10.0 mask 255.255.255.0". I send it to my customer the whole subnet, would my customer get the to 10.10.10.1 & .2 or i would have to specifically mention it seperately. I am already learning the above in my BGP through OSPF. The only way for me to force the OSPF networks so that it looks like BGP is either by " network" statements or by making a "redistribute ospf bgp route-map".

If in redistribution ospf to BGP i put " permit 10.10.10.0 0.0.0.255" then the subnet will become BGP network ...right. Now if i use the network statements how would i define it.

I hope i am clear. I guess i am not clearly explaining it.

Let me know thanks

Hassan..

I am clear or still confusing it.

For any network to be advertised via BGP using the 'network' command a matching route has to exist in the routing table. Let's say you have 10.10.10.1/32 & 10.10.10.2/32 in the routing table but no 10.10.10.0/24 route then BGP wouldn't advertise 10.10.10.0/24.

You can workaround this by adding a static route pointing to null 0 'ip route 10.10.10.0 255.255.255.0 null 0' and advertise 10.10.10.0/24 using 'network' statement under BGP process if that's what you want. Instead, if you want to advertise ONLY the host routes then you need to include two network statments like this one and you wouldn't need a static route as you already have it in the routing table.

route bgp xxx

network 10.10.10.1 mask 255.255.255.255

network 10.10.10.2 mask 255.255.255.255

HTH

Sundar

When you put in the BGP network statements " network 10.10.10.0 mask 255.255.255.0, it includes the 10.10.10.1 & 10.10.10.2 Ips as well.

You dont need to specifically mention them via network statements

HTH, rate if it does

Narayan

> I have found out if you use "network statements" under BGP then there is a Limit of "200".

This limit has been removed in Cisco IOS 12.0. The maximum number of BGP network statements is limited only by available resources (NVRAM, RAM).

see http://www.cisco.com/en/US/products/sw/iosswrel/ps1828/products_command_reference_chapter09186a00800ca5ab.html#wp1020532

Thankyou all for your support and Suggestion. It was really really helpful.

Regards,

Hassan

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:

Review Cisco Networking products for a $25 gift card