OpenVPN: set KeepAlive default settings#10174
Conversation
|
If I remember correctly, there's also a default in OpenVPN, are there errors in the log on the latest version? |
|
Ok, so apparently this is because I am not sure why the server does not have a saner default, as this wrong behavior seems triggered with the default configs... Anyways, this is on:
I attach a the client log here (look for And here are some configs:
After manually adding the values, the line |
|
Neither the ticket nor this PR seems to explain what the actual problem is. As far as I can see this is only due to visual confusion about timeout reconnects? |
The issue is that timeouts should not happen at all on stable links, and they happen repeatedly every few seconds. E.g. any TCP connections over the VPN are immediately broken. In the "legacy" version, there was a hardcoded line to avoid this ( |
Nobody is stating that you shouldn't use the options available, it's just not a generic issue and the old defaults are just different, not better. There might even be situations where the old defaults don't work because some intermediate hop decides to drop the traffic even faster. Tracking the history, the setting was imported from m0n0wall decades ago in a time where NAT issues where probably more common. |
Is it really not a generic issue? Perhaps I am missing something, but in what setup would this now work fine out of the box? Another data point, pfSense is apparently keeping the old default (
Anyways, if you decide not to alter this new default, I respect that (of course), but I would request, at least, to make it not an "Advanced" option. |
|
it's less about the defaults and more about the rationale of changing anything, usually upstream defaults are the ones advised for the application in question for good reasons. Before deciding anything, I do want to rule one thing out, what happens if you change the |
Oh, that I can agree with, my argument is indeed that I believe the upstream defaults are wrong.
I'll give it a go tomorrow if time permits. |
|
thanks, I have a hunch, if that's the case, we can discuss next steps. |
|
Quick update: I have not forgotten this, I just haven't found the time for testing again. |
|
no problem, take your time. |

Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:
If AI was used, please disclose:
I used ChatGPT (model 5.4) to find the relevant files; this text and the code (just two XML lines) are 100% hand-written.
Describe the problem
I came across issue #8106 (periodic OpenVPN client disconnections) while trying to migrate a server instance away from "Legacy" OpenVPN.
As indicated, this is solved by setting a couple of KeepAlive options.
In the Legacy version this was set automatically:
core/src/etc/inc/plugins.inc.d/openvpn.inc
Line 550 in 72a8f6b
And in the new version these are not set:
core/src/opnsense/mvc/app/models/OPNsense/OpenVPN/OpenVPN.xml
Lines 355 to 360 in 72a8f6b
As a result the corresponding
keepalive interval timeoutline is missing from the generated config file.Keeping this new default behavior is highly inconvenient, especially when these options are hidden behind "Advanced mode".
Describe the proposed solution
This restores the previous default values in the new interface, which fixes the underlying issue by default.
Related issue
If this pull request relates to an issue, link it here: #8106