An IP routing table is a set of rules that stores information such as the IP address of the default gateway, the administrative distance, the destination network and many more. This information is therefore about the networks and the best path to forward data packets to. Each data packet contains information about its origin and its destination which is then used by the router to forward the packet to the designated destination.
Network administrators can configure routing tables manually or to be dynamic.
The router uses the routing table to determine the destination address of the next gateway to forward packets. This is also referred too as hop which is when a packet passes through a router. The routing table also helps in determining which is the best path when forwarding a packet. For example, when we have the routers A, B, C and D and when a router A has to forward packet to router D which is not directly connected to it, it will not be able to send the packet to D directly except it passes it through the next hop B which will also forward it to the next hop till the packet gets to D.
Figure 2 is a routing table of the router0 of the diagram in figure 1
The C means directly connected. That means the interfaces FastEthernet1/0 and Serial2/0 are directly connected to router0 as shown in figure 1.
R means Routing Information Protocol (RIP) is configured. Let’s examine some fields of this routing protocol:
For the router 0 to get to the 192.168.3.0/24 network, it has to pass through one router (1 hop) (router1) via the interface Serial2/0 with the IP address 192.168.2.2 in 5 seconds with an administrative distance of 120.
R 192.168.5.0/24 [120/2] via 192.168.2.2, 00:00:05, Serial2/0
For the route0 to get to the 192.168.5.0/24 network, it has to pass through two routers (2 hops) (router1 and router2) via the interface Serial2/0 with the IP address 192.168.2.2 in 5 seconds with an administrative distance of 120.