01-29-2015 05:22 AM - edited 03-05-2019 12:41 AM
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!!
01-29-2015 06:12 AM
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
01-29-2015 08:34 AM
Hello
thx for reply!!
so, the 1st criteria is always prefix length ? doesnt matter the AD at his point ?
thanks!!
01-29-2015 08:37 AM
Yes, the router will always choose the most specific prefix.
If there are still multiple routes then it will use the AD.
Jon
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide