cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1637
Views
19
Helpful
22
Replies

Route selection for BGP

thomuff
Level 3
Level 3

Location A is connected to Location B,C,D via an MPLS network running BGP

Location A has weighted static routes( metric of 250) for Location B,C,D pointing to a VPN Concentrator for a backup VPN connection.

The static routes are winning selection over the advertised BGP routes.

Why are the statics routes winning over the BGP routes?

22 Replies 22

paul.matthews
Level 5
Level 5

I am presuming eBGP? If you take the statics out, do the BGP routes appear? What if you add the static routes when the BGP routes ar actually present in the routing table?

Thomas

Is it possible that the static routes are using a mask that is different from what BGP is advertising? That would certainly allow the static routes into the routing table.

Perhaps you could post the output of show ip bgp to show what BGP is advertising and could post the configuration of the static routes from the config file?

HTH

Rick

HTH

Rick

Here is a piece of the sh ip bgp

* 10.7.7.0/24 10.10.10.1 0 37054 77002 i

*> 10.5.2.1 0 32768 ?

ip route 10.7.7.0 255.255.255.0 10.5.2.1 250

I think whats happening here is as follows

a) Before your bgp route comes in, your static is present in the routing table

b) When bgp peer is established and you start exchanging routes, the bgp table is populated with two routes for 10.7.7.0/24

-------> one through bgp with AS path 37054 77002

-------> one redistributed.

c) Now, in the bgp tables (not the router routing tables) the redistributed route is preferred ( http://www.cisco.com/warp/public/459/25.shtml )

d) Since bgp feels the redistributed route is better (c the sign *> before your redistributed route in the bgp table u supplied) it will not introduce this route back into the routing table and hence this doesnt replace the weighted static.

To resolve this, apply a route map into your incoming bgp advertisements and increase its local preference.

If we take the statics out, the advertised routes immediately enter the routing table. Then, we would put the static routes back in and after a little time, the static routes are back in the routing table. I am thinking it is a time out.

This is for our internal network.

Thomas

I am surprised, but it looks like the static route is getting into the BGP table.

*> 10.5.2.1 0 32768 ?

Are you doing any kind of redistribution with static routes?

Perhaps you could post the output of show ip protocol? This might give us some clue about what is happening.

HTH

Rick

HTH

Rick

We are redistrubting static routes

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

IGP synchronization is disabled

Automatic route summarization is disabled

Redistributing: connected, static

Neighbor(s):

Address FiltIn FiltOut DistIn DistOut Weight RouteMap

10.10.10.1

Maximum path: 1

Routing Information Sources:

Gateway Distance Last Update

10.10.10.1 20 01:03:26

Distance: external 20 internal 200 local 200

So is BGP treating these as locally sourced routes and therefore preferable? Strange behaviour if the statics were not in the routing table in the first place.

What might give us a clue is the " ... after a little time ... " I'm trying to work out what that implies.

Kevin Dorrell

Letzebuerg

hello

the static route SHOULD not make it into the bgp table. But if it does for some reason it will stay forever (due to weight 32768).

At the very least you should set weight to 0 (and localpref to 90) when you redistribute this static into bgp.

bye

Etienne

I think whats happening here is as follows

a) Before your bgp route comes in, your static is present in the routing table

b) When bgp peer is established and you start exchanging routes, the bgp table is populated with two routes for 10.7.7.0/24

-------> one through bgp with AS path 37054 77002

-------> one redistributed.

c) Now, in the bgp tables (not the router routing tables) the redistributed route is preferred ( http://www.cisco.com/warp/public/459/25.shtml )

d) Since bgp feels the redistributed route is better (c the sign *> before your redistributed route in the bgp table u supplied) it will not introduce this route back into the routing table and hence this doesnt replace the weighted static.

To resolve this, apply a route map into your incoming bgp advertisements and increase its local preference.

I think lugmankondeth is right. I had to power this router off last night to fix a fan issue. As soon as the router powered on, the static routes were present in the routing table. I think everyone is right with the local preference. I will post an update once I give it a try. Probably early next week. Thanks again for all the replies.

Now, should I use the

bgp default local-preference command to set it

for example,

router bgp 256

network 10.5.2.0 mask 255.255.255.0

network 3.3.3.0 mask 255.255.255.0

neighbor 3.3.3.1 remote-as 300

neighbor 128.213.11.1 remote-as 256

bgp default local-preference 90

or should set the preference to static routes using a route map

for example

redistribute static setpref

route-map setpref

set local-preference 150

sorry I meant to say

route-map setpref

set local-preference 90

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