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?
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?
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:
make sure the client config file does not contain the following line:
redirect-gateway def1
make sure the server config file does not contain the following line:
push "redirect-gateway def1"
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.