Adding a static route

Hey guys, I am trying to add a static route (not persistant) using Ubuntu. I am connecting to another network via PPTP that uses the same IP address range as my network. When I connect to a computer that is located on the other network, I need the traffic to go through the VPN gateway, obviously.

In Windows I could just do:

route add mask 255.255.255.255

How would that command translate into UNIX speak?

Ta

Don’t know if this is what you’re looking for, but there’s a route program in linux anyway. Wtih similar syntax to your example, take a look at that if you haven’t already.

To list routes:

route -n

You can add a new static route with route add. For example, if you have an IP on 192.168.2.0/24 and you wanted a route to 192.168.240.0/24, you could add a static route like so:

route add -net 192.168.240.0 netmask 255.255.255.0 gw 192.168.2.1…assuming the router providing the route is 192.168.2.1.

Thanks mate, that works perfectly with a “sudo” at the beginning :wink:

[ot]

Every time an Ubuntu user runs the sudo command, a naked molerat is conceived.[/ot]