In this example, you will learn to perform the basic configuration of the static route. First of all, we have to assign the IP Addresses to the router interfaces that are connecting different routers together. After assigning the IP Addresses, you should easily be able to ping the devices that are directly connected. However, to reach out to the routers that are not directly connected, or to reach to the other networks, routers should have their routes specified in the routing table.
Routers can learn their routes with the help of a routing protocol, or else we can specify the static route on those routers so that they can reach other networks that they don’t yet recognize.
And to create a static route, we have to make the router aware of the other networks so that it can reach out to them. And for that, it has to go out to its interface.
For example, in the following scenario we have to tell router 0 that to reach the 192.168.1.0 network, it has to go out to its interface using the IP Address 192.168.1.2
Now, we don’t have to configure the static route on router 1 as it already knows about the networks 192.168.1.0 and 192.168.2.0 being directly connected to these networks. However, we have to configure the static route on router 2 as it does not know about the 192.168.1.0 network.
Once we have configured the static routes, you will be able to see those static routes in your routing table. And finally to confirm, you can try pinging router 2 from router 0 and check if they have been configured correctly.
- configure ip addresses on all routers and establish connectivity
- create a static route on router 0 to reach 192.168.2.0/24 network
- create a static route on router 2 to reach 192.168.1.0/24 network
- Test connectivity by pinging router 2 from router 0