Add multiple DNS servers to OpenVPN roadwarriors

I would like to configure our roadwarriors with two internal DNS servers and in the rare case that both of them are offline, configure a third external DNS server.

The first DNS server is configured in “Advanced server options”. I could configure two DNS servers in the “Advanced client options”, but I guess those would override the global one.
I could manually add a server to the CCD of each client (which would mean extra work each time a new client is created) like this:
push “dhcp-option DNS 1.1.1.1”

Is there a way to configure three DNS servers globally?

Hi,
you can use the ‘Additional configuration’ --> https://wiki.ipfire.org/configuration/services/openvpn/config/advanced_set to set other global directives for server.conf but also for client.ovpn.

Best,

Erik

2 Likes

Thanks, will try this the next days.

Thanks, it’s working now.

Though, it was very confusing that the additional configuration is only copied into server.conf on saving the advanced server options. Not only for the first edit, but also for later edits.
I guess most users will think that a simple restart would be sufficient.

Could you change this, so the server.conf.local is added to server.conf on starting OpenVPN?

Hi Larsen,

you are welcome. This implementation was held in that way to offer a configuration possibility for advanced users of IPFire but also of OpenVPN since you can leave the IPFire concept of the OpenVPN configuration behind and you should know what you are doing, therefore it is a kind of back door configuration possibllity but the kind of reconfiguration is the same then with all other options, you need to stop the server configure it and start it again. A restart is not possible since several core updates.

Best,

Erik

It’s not only a restart, also stop/start isn’t sufficient to add a modified local configuration to the server.conf. You have to explicitly save the advanced configuration (where nothing has changed) to achieve that. That’s confusing.

The local configuration should be updated into server.conf every time OpenVPN is started.

With

“configure” it i meant to make the changes and to press the save button, this is what you need to make for any other configuration changes too, so it is a general behavior.

Best,

Erik

But not when you are editing the local configuration file.

Currently:

  • Edit local configuration file
  • Open GUI > OpenVPN
  • Stop OpenVPN
  • Open Advanced Configuration
  • Save OpenVPN
  • Start server

Proposed way (less hassle, less downtime, more intuitive):

  • Edit local configuration file
  • Stop OpenVPN
  • Start OpenVPN

Hi Larsen,
to complete the “Proposed way”, you would currently also need to “Open GUI > OpenVPN” and “Save OpenVPN”. For the “Currently” way, you need to open “Open Advanced Configuration” only the first time to activate the “Additional Configuration” option from then on you can also use the global section for local file configuration changes (stop|save|start).

But i know what you mean, to read out the configuration the general-functions.pl comes into the game which might be a more in depth operation as far as i know but if you are willing to check this out i can go for some testing or even to help you out as far as i can.

Best,

Erik

It’s not possible to stop/start OpenVPN via init scripts?

By using the global section I agree it’s a little bit simpler, but still not intuitive that I have to save in the GUI after having edited the local configuration file.

Not complaining, just want to improve the user experience for everybody =)

There is no initscript, there is only openvpnctrl → git.ipfire.org Git - ipfire-2.x.git/blob - src/misc-progs/openvpnctrl.c .

Great, if you have some first snippets, i can give it some testing then :slightly_smiling_face: .

Best,

Erik