
Then, in such userconf directory, create one file for each of the user you want to provide such DNS, including in such file the two rows deleted above. So, as for the main config, you should remove: Īnd add reference to the /etc/openvpn/userconf directory (as an example. The following options are legal in a client-specific context: -push, -push-reset, One of the useful properties of this option is that it allows client configurationįiles to be conveniently created, edited, or removed while the server is live, without Well as fixed subnets owned by the client using -iroute. This file can specify a fixed IP address for a given client using -ifconfig-push, as Note that the configuration files mustīe readable by the OpenVPN process after it has dropped it's root privileges. Which may be provided but is not required. If no matching file isįound, OpenVPN will instead try to open and parse a default file called "DEFAULT", Opened and parsed for client-specific configuration options. Same name as the client's X509 common name. Has been authenticated, OpenVPN will look in this directory for a file having the Specify a directory dir for custom client config files. You can do this with: -client-config-dir dir Hence, instead of pushing your config directly in the main OpenVpn config file (.and, as such, provide such config to ALL of your users), you can implement a per-user config. What I suggest is a completely different approach.Īs you explicitely mentioned: " My goal is to automatically apply a default DNS server to not-technically-skilled users, while also allow skilled computer users to set their own DNS servers." it looks like you know exactly which users you want to provide a DNS-config and which users you don't want to provide such config. Unfortunately, in addition to what you're asking, this has the side effect of disabling also the redirect-gateway provided by your configuration and this can represent an issue, for your case. TCP/IP properties of the client's TUN/TAP interface. When used on the client, this option effectively bars the server from adding routes to theĬlient's routing table, however note that this option still allows the server to set the When used with -client or -pull, accept options pushed by server EXCEPT for routes and In the official OpenVPN documentation you can find:


EDIT TUNNELBLICK CONFIGURATION FILE MAC
UPDATE: The clients operating systems are Windows and Mac OpenVPN server config: # cat /etc/openvpn/nfĪuth-user-pass-verify /etc/openvpn/auth-chap via-envĬlient-connect /etc/openvpn/scripts/clientconnect.shĬlient-disconnect /etc/openvpn/scripts/clientdisconnect.sh The DNS pushed by the server remains regardless of the local DNS settings.
EDIT TUNNELBLICK CONFIGURATION FILE PC
Note that simply changing DNS settings on the PC while the 'push "dhcp-option DNS 8.8.8.8"' option is active on the openvpn server, does nothing. My goal is to automatically apply a default DNS server to not-technically-skilled users, while also allow skilled computer users to set their own DNS servers.

Here is the catch, the openvpn server must push a DNS because otherwise many OpenVPN clients will not be able to open web pages until the manually set DNS servers in system's network settings. Is there an option to allow the users to change that DNS servers on the client side? There is an OpenVPN server running on a Debian and it pushes a DNS in the server config file:
