cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
379
Views
0
Helpful
1
Replies

BGP advertised route is locked in routing table

tomc.pnnl
Level 1
Level 1

I have two routes for a prefix:

 

172.18.0.0/16 AD 200 via ibgp

172.18.0.0/16 Null0 AD 225 via static

 

The route selection works as I would expect if the prefix is not advertised by bgp. When 172.18.0.0/16 is advertised by BGP (via network or redistribute static), the preferred ibgp route will not be selected over the static route. If the network/redistribute static statement is removed, the ibgp route is selected as I would expect it to be.

What I want to happen is that the static route is selected and advertised if the ibgp route is not available; otherwise, the ibgp route should be preferred. In either case I want the 172.18.0.0/16 advertised to the remote. How do I accomplish this objective?

 

Much appreciated.

 

~ Tom

router bgp 1
  address-family ipv4 unicast
    network 172.18.0.0 mask 255.255.0.0
  !
!
ip route 172.18.0.0 255.255.0.0 Null0 0.0.0.0 225

1 Reply 1

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @tomc.pnnl ,

locally generated BGP routes have weight 32768 by default and this makes them preferred over the iBGP route coming from another neighbor.

 

To solve this my suggestion is to increase weight for the neighbor advertising the prefix to 40000

router bgp 1

neighbor <x> weight 40000

 

if you want to increase the weight only for a specific prefix you can use a route-map

ip prefix-list SOME permit 172.18.0.0/16

route-map RISE-WEIGHT permit 10

match address prefix SOME

set weight 40000

route-map RISE-WEIGHT permit 20

 

the last empty block allows to accept all other  prefixes without change otherwise they are denied by implicit deny any

router bgp 1

neighbor <x> route-map RISE-WEIGHT in

 

Hope to help

Giuseppe

Review Cisco Networking products for a $25 gift card