vanutsteen.nl => nerds only A blog on rails, php, computing, my bass guitar and stuff

3 useful route commands

on in Linux

To route an ip address through a (vpn) connection:

1
2
3
sudo route add -net XX.192.85.XX netmask 255.255.255.255 gw 192.168.1.1
sudo route add -net 10.76.122.0 netmask 255.255.255.0 gw 192.168.1.1
route -n

Or maybe add a whole range / subnet:

1
sudo route add -net 95.170.89.0 netmask 255.255.255.224 gw 10.76.122.152

Or maybe dynamic?

1
route add -net 95.170.89.0 netmask 255.255.255.224 gw `ip addr show ppp0 | awk '/inet/{print$2}'`

Comments