Run “route -n” command to check the current routes on each PC. Then use “ip route flush table main” command to clear the routing tables. Also, we need to enable IP forwarding on the routers.

Since PC 1 is only connected to subnet 1, we first add a route to subnet 1 using following command:

$ route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.1

To connect PC 1 to other subnets on the network, we either need to add other subnets addresses to the routing table one by one or add a default gateway to send all the packets not intended for Subnet 1 to that gateway.

$ route add default gw 10.0.0.2

Similar to PC 1, we can add the routes to other PCs on the network based on the tables in Figure 1.