14.4 Putting in the final static routes to make it all work
In this next section you are going to fix the network by putting in the final missing routes manually.
Watch the video below, which is about a minute long.
Box _unit8.2.4 Routing with static routes

Transcript
Let’s think about what the router is doing when the ping is being sent to 192.168.2.2. The router will look in its routing table for a match to the 192.168.2.0 network. No matching route exists, and there is no default route, so the packet will be dropped.
We can easily fix this by adding the command ip route 192.168.2.0 255.255.255.0 10.10.10.1 into Router2.
This will put a route in the routing table for the 192.168.2.0 network, again pointing it towards Router1
If we now look at the routing table of Router2, we can see that there is an entry for the 192.168.2.0 network in there now.
Let’s try the ping again and see if it works. This time we can see that it is successful and our network is complete.
We have now configured the two routers in our small network so that traffic can pass among all the host devices connected to them. To do this we have added static routing information to the routing table on each router, using the ip route command. This tells the router which interface to use to forward packets addressed to a particular network address. This information has to be entered manually by the network administrator, so this method is only useful for simple networks that rarely change.
Activity _unit8.2.4 Activity 4 Try it out
20 minutes
Open PT Anywhere [Tip: hold Ctrl and click a link to open it in a new tab. (Hide tip)] in a new tab or window so you can read these instructions.
In this activity you are going to configure static routes on each of the routers to enable the PCs connected to one router to access the PCs connected to the other router.
- Configure PC1 with IP address 192.168.1.2, subnet mask 255.255.255.0 and gateway 192.168.1.1.
- Configure PC2 with IP address 192.168.2.2, subnet mask 255.255.255.0 and gateway 192.168.2.1.
- Configure PC4 with IP address 172.16.2.2, subnet mask 255.255.255.0 and gateway 172.16.2.1.
- Configure PC3 with IP address 172.16.1.2, subnet mask 255.255.255.0 and gateway 172.16.1.1.
- On the routers (Router 1 and Router 2) enter the commands in the table below.
Device | Commands to enter |
---|---|
Router 1 | enable configure terminal (abbreviate this to conf t) interface gi0/0 ip address 192.168.1.1 255.255.255.0 no shutdown
interface gi0/1 ip address 192.168.2.1 255.255.255.0 no shutdown
interface gi0/2 ip address 10.10.10.1 255.255.255.0 no shutdown |
Router 2 | enable configure terminal (abbreviate this to conf t) interface gi0/0 ip address 172.16.1.1 255.255.255.0 no shutdown
interface gi0/1 ip address 172.16.2.1 255.255.255.0 no shutdown
interface gi0/2 ip address 10.10.10.2 255.255.255.0 no shutdown |
- Verify that PC1 can ping PC2 (ping 192.168.2.2) and PC3 can ping PC4 (ping 172.16.2.2).
- Check to see if PC1 can ping PC3 (ping 172.16.1.2) – this should fail.
- On the routers (Router 1 and Router 2) enter the commands from the table below.
Device | Commands to enter |
---|---|
Router 1 | ip route 172.16.1.0 255.255.255.0 10.10.10.2 ip route 172.16.2.0 255.255.255.0 10.10.10.2 |
Router 2 | ip route 192.168.1.0 255.255.255.0 10.10.10.1 ip route 192.168.2.0 255.255.255.0 10.10.10.1 |
- Check to see whether PC1 can now ping PC3 (ping 172.16.1.2) and PC4 (ping 172.16.2.2).
You have now configured static routes so that Router 1 can get to the two networks on Router 2 and vice versa. (Note: if you were to build this network from scratch in PT Anywhere then you would need to place a switch in the link between Router 1 and Router 2. You would also need to have switches in the links between each PC and router. This is because PT Anywhere does not provide the crossover cables for direct links.)