BackgroundI work on a corporate network that is behind a proxy server.  I also work with some remote sites that I am able to access via a bastion / jump host ssh proxy.In my ~/.ssh/config I have a proxy configuration for my SSH tunnels that allows the jumping through our bastion hosts in order to reach the remote labsHost *.remoteLab1    ProxyCommand ssh -l USERNAME BASTIONHOST1 nc %h %pHost *.remoteLab2    ProxyCommand ssh -l USERNAME BASTIONHOST2 nc %h %pI use both OSX and Linux so I assume the commands are more or less the sameCurrent SolutionMy current solution is less than ideal.  I basically make a socks connection to one of the remote labs such as:ssh -D 1080 remoteLab1ssh -D 1081 remoteLab2Then in both realvnc and chrome I change the proxy server to localhost:1080 / localhost:1081.  In chrome I have a plugin that allows me to do this and in VNC its manual.As both of these remote labs have a unique domain I was wondering if there is an easier way playing with routing tables to send all traffic through these socks proxies based on ip addressRequested SolutionGIVEN: A socks5 tunnel is open on port 1080GIVEN: A socks5 tunnel is open on port 1081Requirementsaddresses of domain1.org go through 1080addresses of domain2.org go through 1081fall through case - everything else goes through standard proxy serverNice-to-have'sThe solution is not permanent - it is enabled by a script in conjunction with turning on one of the socks tunnelsIs it possible to also map specific ip addresses as opposed to domains through one of the proxy serversIdeasI'm not really sure at all where to start with all of this.  One solution I saw somewhere was to use a proxy.pac however the corporate network already has a proxy.pac and I wasn't sure if there is a way to do a fall-through pac where if not in my custom .pac then use the settings in the corporate .pacUsing the iptables or route command - however both of those are a little out of my knowledge zoneSetting up local loopbacks or something
How to route traffic through different proxy servers based on destination
iptables;proxy;route;socks