3 useful route commands

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

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:

sudo route add -net 95.170.89.0 netmask 255.255.255.224 gw 10.76.122.152

Or maybe dynamic?

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

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment