Lets check path selection in routing ,
Find the longest match:- We want to go to 1.2.3.4 and in the routing table there are three entries like
1.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
S 1.0.0.0/8 [1/0] via 172.16.12.1
S 1.2.0.0/16 [1/0] via 172.16.12.2
S 1.2.3.0/24 [1/0] via 172.16.12.3
Then it will choose 1.2.3.0/24 because it is more accurate than the other routes.
If there are multiple longest matches then it will check whether they are coming from different protocols or same protocols. If they are coming from different protocols then it will check the AD value of each routes and will choose the path which has lowest AD value.

If they are coming from same protocols then it will check the metric and will choose the path which has lowest metric.
Leave a comment