Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently running an OpenVPN server for multiple clients. All traffic is directed through the VPN (it's set up as gateway; push "redirect-gateway def1").

So far, all is working fine. However, I'd like to connect a couple of servers to this virtual private network, without these servers using the OVPN daemon as gateway.

These servers have to be accessible from both their WAN as well as their LAN IP address. Certain services will be accessible only from the LAN side.

Is there any way, for a client, to ignore the push redirect-gateway option?

Kind regards, Tuinslak

share|improve this question
Great question... I was asking myself exactly the same thing. – Antoine Benkemoun Apr 6 '10 at 8:05

Just add "route-nopull" to the client openvpn config, then all pushed commands from the server are ignored. To get access to the local net, you must now add e.g. "route" to the client openvpn config, if the local net you want to connect to is

share|improve this answer

if 'redirect-gateway' is required for some but not all clients then add a 'client-config-dir' option e.g.

  client-config-dir /etc/openvpn/clients

and inside that directory put files for each client CN, e.g. file Client1 would contain


that way the servers don't get the 'redirect-gateway' pushed by default.


share|improve this answer
worked for me! thanks! – Sirber Jan 4 '12 at 18:30
I guess this would reset every pushed option (including DNS servers)? – Tuinslak Feb 26 '12 at 0:59

just replace the default gateway in --up script an you are all set. You don't even have to do anything in --down (I think) or just set it to as well.

in client.conf


in (chmod +x)

/sbin/ip route replace default

where is your client's default gateway

share|improve this answer

Remvoe "redirect-gateway" option in the client configure file, the client's default gateway won't change anymore. tested under Archlinux/OpenVPN 2.3.2.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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