Understanding Routing Basics - Static Routes - Part 2

Routesspecific for routing the packet wanting to get to
Static routes are build in the same way as default20.1.1.23.
routes, in the sense that they have a destinationThe very first choice that a router makes is
a prefix and a next hop, the difference being thatlongest match irrelevant of how the route was
a static route informs the router about speciflearnt.
routes rather than an “any” route like aMatching Routes
default route does.What would happen if the router has two
An example of the static route would be:matching routes:
Ip route 20.1.1.0 255.255.255.0 10.1.1.01: Ip route 20.1.1.0 255.255.255.0 10.1.1.0
The first part of the route, the address2: Ip route 20.1.1.0 255.255.255.0 10.5.5.0
“20.1.1.0” tells the router that this routeThe static routes above have the exact same
specifies the destination of 20.1.1.0.destination addresses and the exact same prefix
The second part of the route tells the routerlengths, so which one will the router believe?. The
which part of the destination address in the firstrouter will in this case begin to share the traffic
part of the address it needs to look at, theacross both paths, if this is your desired result
“255.255.255.0” instructs the router to lookthen you are done, what if it is not, how do we
at the first three octets in the destination addressforce the traffic to take one route over the
and ignore the 4th octet. We could have writtenother?. This is achieved by setting what is
the destination address as follows “20.1.1”,referred to as the “trust-ibilty” of the route.
but the command line will not allow us to do that.Every route that populates the routing table is
The prefix in the route tells the router which partassigned an “Administrative distance”
of the destination address the router needs tobetween 0 and 255. The lower the value; the
look at.more desirable the route. All static routes have an
Example 1: The following two static routes areAdministrative distance of “1”. This value can
now in our example router:be changed.
1: Ip route 20.1.1.0 255.255.255.0 10.1.1.0Administrative distance is a local value on the
2: Ip route 20.1.0.0 255.255.0.0 10.5.5.0router; a router never advertises this to any
Our router receives a packet with the destinationother router.
address set to “20.1.1.23”, the router will1: Ip route 20.1.1.0 255.255.255.0 10.1.1.0 1
examine the routing table and choose between2: Ip route 20.1.1.0 255.255.255.0 10.5.5.0 2
the two routes. The router will choose route 1Even setting the Administrative Distance to 2
since it is a closer match for the destinationmakes route two less desirable. The router now
address in the packet header. The second route ischooses to use route one to pass traffic to
less specific or “broader” matchingdestination network “20.1.1.0”
“20.1.0.0 255.255.0.0” meaning “use thisNow we know that the router makes the
route if the packet wants to get to anyfollowing routing decisions in the following order
destination starting with “20.1. anything.1. longest match irrelevant of how the route was
Anything” whereas the first route matcheslearnt
“20.1.1.anything” making this route more2.