in Linux, Ubuntu

Routing to allow SSH over a specific interface


Sometime when you have two network interfaces (say eth0 and eth1) on the client and for some reason there is a need to SSH to the server over a specific a specific interface. By default the primary interface will be used. To use eth1 we just need to add a route:

route add -net 10.75.0.0 netmask 255.255.255.0 gw 192.168.0.1 eth1

The route is removed upon reboot. Use -p to permanently add the route to the table. To delete the route:

route del -net 10.75.0.0 netmask 255.255.255.0 gw 192.168.0.1 eth1