Redirect traffic to a specific network


This is a little trick which can be useful in some very specific case.

For example, you could have a machine with two network cards. One of the network is behind a proxy and the other one is connected directly to the internet.
You might want to forward all the traffic for google.com to the network which doesn’t have a proxy.

To do this, I am using the command route:

route add <hostname> <target network>

For example:

route add google.com 192.168.101.1

Note that this command is available on both Linux and Mac.

, , , , ,


  1. #1 by Nicolas Hug on 22 Jan 2016 - 12:13

    Thanks a lot for this tip !

(will not be published)