I have a corporate network to which remote access is provided via openvpn. Customers include a variety of devices (laptops, smartphones). These devices running software that accesses corporate resources. Transparency of the work for the customer is provided with the addition of a default route through the openvpn (push gateway option). As a result, I have two default route in the routing table. Old default route I remove a script (using the up option in the configuration file openvpn). Then everything is working properly, all traffic goes through the vpn tunnel. When customers perform update the network settings through the dhcp, it automatically adds the default route through a router (the same which I removed with a script before)

What is the simplest way to prevent adding a new default route via dhcp?

  • what os, and do you have permission to staticly configure your IP address on this network? Feb 12, 2017 at 18:22

1 Answer 1


If you can change openvpn configuration you can add, instead of the default route, the following two routes:

  • via tunnel
  • via tunnel

In this way the kernel always choose the /1 route because it has a longer subnet mask.

It's a workaround, but in many cases it works.

OpenVPN even has an option to do this: add def1 to the redirect-gateway configuration entry or flag.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .