| Routes | | | | specific for routing the packet wanting to get to |
| Static routes are build in the same way as default | | | | 20.1.1.23. |
| routes, in the sense that they have a destination | | | | The very first choice that a router makes is |
| a prefix and a next hop, the difference being that | | | | longest match irrelevant of how the route was |
| a static route informs the router about specif | | | | learnt. |
| routes rather than an any route like a | | | | Matching 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.0 | | | | 1: Ip route 20.1.1.0 255.255.255.0 10.1.1.0 |
| The first part of the route, the address | | | | 2: Ip route 20.1.1.0 255.255.255.0 10.5.5.0 |
| 20.1.1.0 tells the router that this route | | | | The 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 router | | | | lengths, so which one will the router believe?. The |
| which part of the destination address in the first | | | | router will in this case begin to share the traffic |
| part of the address it needs to look at, the | | | | across both paths, if this is your desired result |
| 255.255.255.0 instructs the router to look | | | | then you are done, what if it is not, how do we |
| at the first three octets in the destination address | | | | force the traffic to take one route over the |
| and ignore the 4th octet. We could have written | | | | other?. 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 part | | | | assigned an Administrative distance |
| of the destination address the router needs to | | | | between 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 are | | | | Administrative 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.0 | | | | Administrative distance is a local value on the |
| 2: Ip route 20.1.0.0 255.255.0.0 10.5.5.0 | | | | router; a router never advertises this to any |
| Our router receives a packet with the destination | | | | other router. |
| address set to 20.1.1.23, the router will | | | | 1: Ip route 20.1.1.0 255.255.255.0 10.1.1.0 1 |
| examine the routing table and choose between | | | | 2: Ip route 20.1.1.0 255.255.255.0 10.5.5.0 2 |
| the two routes. The router will choose route 1 | | | | Even setting the Administrative Distance to 2 |
| since it is a closer match for the destination | | | | makes route two less desirable. The router now |
| address in the packet header. The second route is | | | | chooses to use route one to pass traffic to |
| less specific or broader matching | | | | destination network 20.1.1.0 |
| 20.1.0.0 255.255.0.0 meaning use this | | | | Now we know that the router makes the |
| route if the packet wants to get to any | | | | following 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 matches | | | | learnt |
| 20.1.1.anything making this route more | | | | 2. |