This tutorial will show you how to create or remove static routes used to override the default gateway configured for certain networks. In this section I will be describing what a routing table is and how static routes play a role in this configuration.
What is a Routing Table?
A routing table is table that contains dictates who and what interface traffic should be sent to depending on the destination IP address. It is the primary component in the configuration of routers to ensure internetwork connectivity as packets are routed to their destination. For a Windows machine it is used to override the default gateway configured so you can introduce multiple networks and have the two networks be able to communicate with each other.
For example, consider this small routing table configured on a router:
When the router receives a packet with a destination IP address of
172.16.1.X (
'X' being a value between 1 and 254) it will first look at it's routing table to find a corresponding route. With the scenario there is route that matches telling the router to route the packet to
10.1.1.2. From there
10.1.1.2 will look at its routing table and look for a similar route telling it where to forward the packet destined to the
172.16.1.0 network. This will continue until the packet reaches its destination. This is the main concept of how routers work. For Windows machines the same logic applies with the routing table being used to determine what interface and destination gateway/router to send the traffic to.
For example:
Any traffic destined to
10.1.1.X will be sent out the interface configured with the IP address of
192.168.0.30 to a destination gateway of
192.168.0.110. This may seem no different to normal however when put into perspective it can be seen that the default gateway configured is
192.168.0.1. This routing table overrides this use and allows traffic to be routed to any device you want.
______________________________________________________________________________
How do static routes come into this?
By default a routing table will only contain routes relevant to the default gateway and therefore does little to change the routing process. Static routes are manual entries made into the table to override the default gateway for allowing traffic to be exchanged between networks. The previous examples provided were examples of static routes made. They will typically have a gateway different to the default one configured as well as a low value for the metric.