The Routing table instructs where all packets go the moment they leave your system. On majority of environments, all packets that leave your system will automatically be forwarded over to your router or hub, and subsequently from there out to the internet.

In a number of circumstances, you may have a testing network set up to duplicate another environment, or you may be setting up a more complex network topology that requires the use of additional routes. Adding routes to your computer is practically a useful testing tool for some of these instances.

Syntax:

route ADD xxx.xxx.xxx.xxx MASK xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx

Means:

route ADD “network” MASK “subnet mask” “gateway ip”

For instance, if you were on the 192.168.1.0 network, and you had a gateway on 192.168.1.12 set up to access the 10.10.10.0/24 network, you would need to use a route add statement like this:

route ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12

Your routing table should be able to reflect that change so all traffic to the 10.10.10.x range will now be sent over to the gateway machine.

The route add set up will only stick across reboots if you add it with the -p flag, like in the following:

route -p ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12

0 comments