Friday, September 3, 2010

Access to various networks on Linux

Big corporations often sub-divide their networks into small networks, hidden behind gateways. To access
them, you need to tell your Linux system that there is a gateway to use to access the networks.
The route program makes it easy to add networks, hosts and gateways to your routing table. To add a default
gateway, for example to access the Internet, you can set it as default with the following line:
route add default gw 10.0.0.1
This will work if you need to access the Internet via the 10.0.0.1 gateway. Now, if you want to access
networks 10.1.0.0 and 10.2.0.0 through other gateways, here is what you will want to do:
route add -net 10.1.0.0 gw 10.0.0.10
route add -net 10.2.0.0 gw 10.0.0.20

No comments: