Is it possible to set up OpenVPN on the client so that the gateway is used only on chosen destinations?

I have read this answer OpenVPN make redirect-gateway optional on making the use of the gateway optional, via push-reset.

If any client is configured to route certain destinations through the VPN, by using say FoxyProxy or changing the routing tables will the forwarding work as normal?

1 Answer 1


You can configure the server to push only certain routes to its clients. For example, in order to force only traffic to through the VPN, add the following to your server's configuration:

push "route"

Of course, for this to work, the redirection of the default gateway needs to be switched off. To do this, remove any push "redirect-gateway ..." directive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.