Thursday, March 3, 2011

How to Add Routes in UBUNTU

Lets say that you want to enable network from this subnet 192.168.26.0 eg
PC 1              IP:192.168.26.5
GATEWAY: IP:192.168.26.1

to reach your UBUNTU box e.g get a file from the UBUNTU box which is on a different network subnet from PC1 but then PC 1 can reach a router IP 10.0.0.70 and your UBUNTU box can also reach the router IP 10.0.0.70?

You proceed to add the following route at the terminal

#route add -net 192.168.26.0 gw 10.0.0.70 netmask 255.255.255.0 dev eth0

Note that I am assuming your subnetmask from PC 1 is 255.255.255.0 and that your active network card 'hardware' on your UBUNTU box is eth0

No comments:

Post a Comment