OS X OpenVPN — connect via VPN only to one IP

1

I have an OpenVPN connection and I want to connect via this connection only to one IP, and route all other traffic via usual network connection. How should I do it?

int_32

Posted 2013-12-02T23:46:51.897

Reputation: 131

Answers

1

First a caveat: using an OpenVPN like this is not very different from having an ssh session, so what is the point of the increased amount of work?

Still, if this is what you wish, there are a few things to check:

  1. make sure the client config file does not contain the following line:

    redirect-gateway def1
    
    1. make sure the server config file does not contain the following line:

      push "redirect-gateway def1"

    2. if the server config file does contain the preceding line, then you will have to act on your routing table. Delete the default gateway that you find when you are logged into the OpenVPN, and substitute it with your normal local gateway, adding the specification

      dev en0

at the end of the rule. This instructs the kernel to use the ethernet interface (substitute the name of your wifi NIC if you are using that instead of the ethernet interface) instead of tun0/tap0, the OpenVPN interfaces in routed/bridged modes respectively, for any generic address.

MariusMatutiae

Posted 2013-12-02T23:46:51.897

Reputation: 41 321