Does the order of IP routes matter?
workfrom925
Member Posts: 196
in CCNA & CCENT
This Cisco page linked here shows the following IP routes. Configuring a Gateway of Last Resort Using IP Commands - Cisco Systems .
When I duplicate the network in Packet Tracer, I notice the 131.108.0.0/24 route come ahead of 161.44.0.0 route. How does this happen? Does the route order affect anything?
Gateway of last resort is not set 161.44.0.0/24 is subnetted, 1 subnets C 161.44.192.0 is directly connected, Ethernet0 131.108.0.0/24 is subnetted, 1 subnets C 131.108.99.0 is directly connected, Serial0 S 198.10.1.0/24 [1/0] via 161.44.192.2
When I duplicate the network in Packet Tracer, I notice the 131.108.0.0/24 route come ahead of 161.44.0.0 route. How does this happen? Does the route order affect anything?
Gateway of last resort is not set 161.44.0.0/24 is subnetted, 1 subnets C 161.44.192.0 is directly connected, Ethernet0 131.108.0.0/24 is subnetted, 1 subnets C 131.108.99.0 is directly connected, Serial0 S 198.10.1.0/24 [1/0] via 161.44.192.2
Comments
-
smcclenaghan Member Posts: 139The order does not matter for routes like it does for ACLs.
The only criteria for choosing routes is finding the most specific stable route which includes the destination.
In the case you describe, if you were trying to route to 161.44.192.3, the 161.44.192.0/24 is more specific than 161.44.0.0/16, so the /24 would be used. The 131.108.0.0/24 would not come into play in either case. -
WilyOne Member Posts: 131workfrom925 wrote: »Does the route order affect anything?
No. The order it's displayed to you in the CLI has no bearing on the routing algorithms used internally to make routing decisions. -
xXErebuS Member Posts: 230smcclenaghan wrote: »The order does not matter for routes like it does for ACLs.
The only criteria for choosing routes is finding the most specific stable route which includes the destination.
In the case you describe, if you were trying to route to 161.44.192.3, the 161.44.192.0/24 is more specific than 161.44.0.0/16, so the /24 would be used. The 131.108.0.0/24 would not come into play in either case.
Exactly; this is where a lot of people get confused on why sometimes a route with a higher AD is chosen over a route over lower AD - this is because the higher AD is more specific. -
Samo3411 Member Posts: 35 ■■□□□□□□□□i think the router always go throught every single route on its table before choosing the best route and thats how the router can find the most specific route thats also why u should try the routing table as short as possible so the order of the routes is the routing table is not important,
-
networker050184 Mod Posts: 11,962 Modi think the router always go throught every single route on its table before choosing the best route
This is not the case. The FIB is structured as a mtrie which allows for faster lookups with out looking through the whole routing table every time. The Cisco Press book Cisco Express Forwarding is a good reference on this.An expert is a man who has made all the mistakes which can be made.