BGP redundant connection:Do I need to change OSPF cost?

Unanswered Question
Feb 24th, 2010


Imagine that my goal is to let traffic flow through site1-br-gw. In case site1 link or components are unavailable, then traffic should flow via site2-br-gw (via gw5 and gw6). Please find attached diagram and existing OSPF config on 4507's.

So I built conifguration using full-mesh BGP peering among the (4) 4507's involved. I did peer the respective site1 and site2 4507's with the respective border router for the respective site.

In order to make site1 as the preferred path (via gw5 and gw6) do I need to change the cost of the OSPF advertisements in this case? Or should I just do higher local-preference in BGP (on site1 gw5 and gw6)?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Giuseppe Larosa Thu, 02/25/2010 - 00:42

Hello Marlon,

local preference can be used within a single AS.

if the objective is to have peer AS 65111 to prefer site1 as exit point for net you should use MED

site1 routers has to advertise with a lowest metric then site2

ip prefix-list net10p1 permit

route-map setmetric permit 10

match ip address prefix-list net10p1

set metric 100

on site 2 you use a greater value of MED

ip prefix-list net10p1 permit

route-map setmetric permit 10

match ip address prefix-list net10p1

set metric 850

as a result of this site1 is used until one router in site1 is alive.

for traffic going into the other direction you can use local preference to make site1 the preferred exit point towards networks advertised by AS 65111 (my guess is they should be IP subnets of your other sites/remote sites)

so site1 needs a route-map to be applied inbound to rise local preference

or even a simple neigh  local-preference 200

changing OSPF costs is not recommended becuase the effects are global and not limited to BGP prefixes.

Hope to help


news2010a Thu, 02/25/2010 - 08:41

Let me make sure I explained this correctly:

I own Site1 and Site2 devices (GW5, GW6 and GW1 and GW2). I do not have control over AS 65111 Corporate routers.

Then I want to control traffic going outbound from my AS 100 towards the Corporate AS 65111. I want to make sure site1 as the preferred exit path.

I thought that MED and AS-PATH should be used only if I was trying to control traffic in the other direction (that means Corporate sending traffic to my AS 100) ?

From a BGP documentation:

"When you manipulate the local preference, you affect the way that traffic leaves the local AS"

For that reason I always thought that I should set local-preference on GW5 and GW6 to 200 and leave the GW1 as 100. Sorry I got confused on this.

Giuseppe Larosa Thu, 02/25/2010 - 11:16

Hello Marlon,

sorry if I've been not clear but we are saying the same things:

local preference (highest value preferred) can be used to select site1 as preferred exit point towards AS 65111

lowest MED (lowest value preferred)  advertised to AS 65111 can be used to influence return path from AS 65111

Routers in site1 has to set the highest preference value on routes learned from eBGP neighbor in AS 65111 to be the preferred exit point towards AS 65111.

then depending on how the internal network is advertised in BGP the MED field can be filled with the OSPF cost to the prefix.

However, you can set MED with a route-map applied outbound as in the examples in my first post.

Hope to help


news2010a Thu, 02/25/2010 - 17:31

Let's assume that the Corporate folks are willing to control how they send their traffic towards my AS (using local-preference to set the 7206 router at site1 as the preferred path).

In that scenario, I should not worry setting up MED from my side  and if the Corporate people prefer to work on that instead, that would be a preferrable implementation and a methodology more precise than if I use MED from my side.

Is that my statement correct?


This Discussion