cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
943
Views
13
Helpful
14
Replies

OSPF =BGP Redistribution

sameermunj
Level 1
Level 1

Hi

i am doing BGP with 2 diffrent service providers with internet links terminated on 2 diffrent routers.i will accept only default route from both the service providers.now both the internet routers are connected to 2 diffrent L3 switches with Each router connected to both L3 switches.Behind the L3 switch is the Public IP pool which will be actually announced in BGP with service provider.Between Internet router and L3 switch i am running ospf.

I will redistribute the default route from BGP into ospf and Ospf will be redistributed into BGP so that internal Public IP pool will be reachable to Internet router and would be able to announce the same.

now instead of redistributing BGP into ospf i am configure default-information originate metric 1 under ospf will my purpose will be served ?? i want that both the L3 switches should get the default route towards Internet routers.

secondaly if i just redistribute ospf 100 (Processs) under BGP,will my internet router will get the public ip pool.

Diagram has schematic details..

14 Replies 14

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Sameer,

to advertise the public address pool use

router bgp xx

network x.x.x.0 mask y.y.y.0

actually BGP can advertise a route if it is present in the routing table it is not limited to connected routes like OSPF and other IGPs.

so you don't need to redistribute OSPF into BGP.

And as you have noted you don't need to redistribute BGP into OSPF too.

you can use

router ospf zz

default-information originate type 1 route-map check_bgp

ip prefix-list only-default permit 0.0.0./0

access-list 11 permit host ebgp-peer-ip-address

route-map check_bgp

match ip address prefix-list only-default

match ip next-hop 11

set metric 50

in this way an OSPF default route of type 1 O E1 is generate with seed metric 50 only if the default route in routing table comes from the eBGP session

you need to do this on both internet routers.

type O E1 allow to sum seed metric and internal metric and is recommended for multiple exit points

Hope to help

Giuseppe

very much clear.

Now regarding Public ip pool announce ment,The L3 switch has static route towards internal network and L3 switch is announcing same in ospf with Internet router so internet router has same in routing table and he can announce the same to BGP peer.I think u r going with same logic right? pl confirm

didnt got the purpose of access-list 11 permit host ebgp-peer-ip-address

in the route map.

Now both my L3 switches will have multiple default routes so i can enable CEF (Per destination )and can have all paths active right

Hello Sameer,

>> so internet router has same in routing table and he can announce the same to BGP peer

yes

>> didnt got the purpose of access-list 11 permit host ebgp-peer-ip-address

in the route map.

this is to check that the default route in routing table as next-hop = eBGP peer address. It is a way to verify eBGP session is up.

>> Now both my L3 switches will have multiple default routes so i can enable CEF (Per destination )and can have all paths active right

yes, flow based CEF load balancing is enabled by default

Hope to help

Giuseppe

just to add this suppose i want to use 2nd internet link as standby link then i think i just need to assign less local preference to the default route received in 2nd internet router or with keeping same local preference i can set the metric in the route map which is attahced with default information originate.

route-map check_bgp

match ip address prefix-list only-default

match ip next-hop 11

set metric 100.

will this work or anything else needs to be done.

Hello Sameer,

if you want to use the second ISP as a backup you can do exactly as you suggest:

by increasing the seed metric the default route generated by ISP1 is preferred.

You may want to try to influence inbound traffic by using as path prepending of your own AS towards ISP2.

route-map prepend-to-isp2 permit 10

set as-path-prepend XX XX XX XX

router bgp XX

neigh isp2-ip-address route-map prepend-to-isp2 out

Some inbound traffic on link to ISP2 will be still observed.

Hope to help

Giuseppe

Hi

With Immediate implementaion i have slight change in design wherein i am removing the cross links between Internet Router and L3 switch because of non availability of Ethernet interface on my 3845 (1Gig used for internet and other gig used for L3 Switch.within 1-2 months i can add Ethernet Hwic Card for my lan side connectivity and free the Gig for 2nd internet link)

In this setup i am not able to run both links parallaly..whats ur suggesstion to start with this setup.

Hello Sameer,

by using OSPF O E1 metric type 1 you should be fine even without the cross-over links.

It is enough that the difference in seed metrics is higher then OSPF path cost switch2 to internet router1 to achieve the desired behaviour.

Hope to help

Giuseppe

It is enough that the difference in seed metrics is higher then OSPF path cost switch2 to internet router1 to achieve the desired behaviour.

===can u please elaborate on this little bit.its bit confusing.

Hi

in my last post i have asked the explaination for== It is enough that the difference in seed metrics is higher then OSPF path cost switch2 to internet router1 to achieve the desired behaviour.

what i thought on the same is as below...

== Switch 1 will have 1 default route from ISP Router1 with cost eual to seed matrci value and Second default route for ISP 2 from Switch 2 over the 100 mbps link with cost eual to seed matric value + cost on 100 mbps link (10).Similar is case for Switch 2.so if we want to use both links as active active then

== matric in Router 1 should be 110 and in Router 2 should be 100 so switch 1 will have default route from Router1 with cost 110 and from Router2 with cost 100 +10 (Switch1=Switch2 100 Mbps link) so switch 1 will have 2 default route with equal cost 110 and he can use both paths.Switch 2 will have default route with metric 100 from Router 2 and can use ISP2.

==If we want to use link from ISP 2 as standby then matric in Router1 will be 100 and in Router 2 it will be 120 so switch 2 will accept default route from Router1 with cost 100+10 instaed of using the default route received from Router 2 with cost 120.So Link on Router1 will be active at a time.

please correct me wherever i am going wrong..

Hello Sameer,

without the cross-over links you need to go from Switch1 to Switch2 and then you reach internet router2.

With O E1 external routes the internal cost to reach the ASBR is added to the seed metric.

Note: the ASBR should be identified by its OSPF router-id that is a loopback.

So without the cross-over links path cost to ASBR2 is:

1+10+1

link between Switch1,Switch2; link between Switch2 and ASBR2, cost to reach loopback on ASBR2.

other note:

multilayer switches may require the use of ip ospf cost to make the costs of 100 Mbps links equal to 10 as happens.

FE cost is 10 only f you change the reference bandwith inside the ospf process.

router ospf 10

auto-reference bandwidth 1000

the number in in Mbps

otherwise everything has cost 1 (it cannot be lower).

It is also recommended that two sides of the same link has the same cost.

This is important on the 100 Mbps links that can be seen as high speed links if they are not routed ports (if you use SVI vlans as L3 interfaces they have a default bandwidth settings of at least 1GBps)

So if you use 100 seed metric on ASBR1 and 150 on ASBR2 you achieve a primary/backup schema.

Hope to help

Giuseppe

Hi

Thanks for the reply..As i mentioned if we try to manage the metrics like in ASBR1 110 and ASBR2 as 100 will i be able to use both links as Switch 1 will get Default route1 from Router1 with cost 110 and Default route2 from Switch 2 with cost 100 +10=110..or active active wont be possible only..

Hi

can i have a final input on the same.

Hi

can i have a final input on the same.

Hello Sameer,

this is possible the difference in seed metric has to compensate for the path cost for Switch1 to reach ASBR2.

You will see on Switch1

O E1 0.0.0.0/0 [110/ 110] via ASBR1

via link to Switch2

Note: this works only from the point of view of Switch1 that has to be the Active HSRP router on all client vlans this is the price to pay for the currently missing cross links.

When the cross links will be added you can consider to use GLBP on the client vlans so that also Switch1 and Switch2 work in load balancing.

Other routers/multilayer switches more internal then Switch1,2 will calculate the SPF from their own point of view.

Hope to help

Giuseppe

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:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco