cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
967
Views
0
Helpful
3
Replies

L3 SW preferring BGP /32 route than /24 directly connected

fabiogarcia
Level 1
Level 1

Dears I have this scenario

L3-SW----(bgp)-----Border router---[MPLS cloud]

In order to advertise some specific routes /32 thru specific links in our MPLS network, I did the following BGP config

static routes pointing to L3-SW, command "network X.X.X.X mask 255.255.255.255" into BGP, and route maps with prepend....

so far so good....  (Those networks are behind the L3-SW).... OK

 

Then problem is Router is advertising these routes /32 to L3-SW as well.... and that L3-SW is preferring a BGP route then a directly connected network

SW-CORE-BTF-01#sh ip route 193.242.39.0  
Routing entry for 193.242.39.0/24, 8 known subnets
  Attached (1 connections)
  Variably subnetted with 2 masks

B       193.242.39.16/32 [20/0] via 193.242.39.6, 03:18:32 (this is directly connected....)
C       193.242.39.0/24 is directly connected, Vlan10

....

I know that /32 is more specific... but how about ADM Distance? 

Why router preferred a BGP route than a connected route ?

 

 

thanks for any help on that!!

 

 

 

 

3 Replies 3

Jon Marshall
Hall of Fame
Hall of Fame

The AD is only taken into account after the router has found the most specific route ie. the longest match.

So in you case the router will always prefer the host route because it is the longest match.

I don't understand why you are doing this though as the next hop IP is the same from the border router unless you don't want to advertise out the whole subnet.

If so then you need filter those routes on your border router ie. stop it advertising those routes back to the L3 switch but allow all other routes.

Jon

Hello

 

thx for reply!!

 

so, the 1st criteria is always prefix length ? doesnt matter the AD at his point ?

 

thanks!!

Yes, the router will always choose the most specific prefix.

If there are still multiple routes then it will use the AD.

Jon