Search code examples
ubuntuvpnrouteropenvpn

VPN on specific websites only


An openVPN connection in my Ubuntu 14.04. I would like to use that VPN when I access to some specific websites only.

For example, go to google.com through VPN, but access stackoverflow.com without VPN.

I don't want to switch the VPN connection on and off, how could it possible? Have no idea how to do, router tables? or some other configs?


Solution

  • I solved my problem by appending

    route 123.123.0.0 255.255.0.0 net_gateway 5
    

    in .ovpn file, then launch the VPN by

    openvpn --config this-file.ovpn