10-05-2015 06:51 AM - edited 03-08-2019 02:03 AM
hi,
i went through the following document -
I just wanna know whether longest prefix match is considered first over AD and metric or it is considered separately while routing
Thanks,
Vish
Solved! Go to Solution.
10-05-2015 07:09 AM
Hey that's the order it goes in below longest match always checked first
The Longest Match Rule
Administrative Distance
Metric
10-05-2015 07:13 AM
Vish
Longest prefix is always considered before anything else.
Then if there are multiple routes from different routing protocols with the same prefix and subnet mask it comes down to AD.
Then if there are still multiple routes within the same routing protocol it comes down to metric.
If there are still multiple routes then it depends on the routing protocol ie. IGPs such as EIGRP/OSPF will install equal cost paths although how many depends on the protocol itself whereas BGP, for example, will by default only install one of the routes because it uses additional attributes to select a route.
Jon
10-05-2015 07:09 AM
Hey that's the order it goes in below longest match always checked first
The Longest Match Rule
Administrative Distance
Metric
10-05-2015 07:15 AM
Thanks Mark
10-05-2015 07:13 AM
Vish
Longest prefix is always considered before anything else.
Then if there are multiple routes from different routing protocols with the same prefix and subnet mask it comes down to AD.
Then if there are still multiple routes within the same routing protocol it comes down to metric.
If there are still multiple routes then it depends on the routing protocol ie. IGPs such as EIGRP/OSPF will install equal cost paths although how many depends on the protocol itself whereas BGP, for example, will by default only install one of the routes because it uses additional attributes to select a route.
Jon
10-05-2015 07:14 AM
Thanks Jon
10-05-2015 07:20 AM
No problem.
Just to clarify the link you posted to was about building the routing table which is what my answer was about.
Obviously there is also the routing of the packets and this will always use the longest match prefix but the others don't really come into it here ie. you wouldn't have the same prefix and subnet mask with two different ADs because the router would only place one of them in the IP routing table.
Jon
10-05-2015 07:58 AM
gotcha!!
10-05-2015 07:21 AM
Yes longest prefix is always preferred and then attributes such as AD come into play.
If you have routes to the same destination (with same subnet mask) but the AD is different, the better AD route will be placed in the routing table. You have routes to the same network, with different masks then both will be installed in the routing table, e.g.:
router# show ip route .... D 192.168.32.0/26 [90/25789217] via 10.1.1.1 R 192.168.32.0/24 [120/4] via 10.1.1.2 O 192.168.32.0/19 [110/229840] via 10.1.1.3
The traffic towards these networks will then be decided based on the destination IP address and subnet mask.
I hope thats clear, if not this this short read should clear it up:
http://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/8651-21.html
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