OpenVPN Client Disconnects/Reconnects every minute or two

Started by jengland, February 06, 2025, 12:23:29 AM

Previous topic - Next topic
Greetings,

I am attempting to create a site-to-site VPN with OPNsense on both ends.  I have followed the directions detailed in the OPNsense docs about using the new "instances" interface to create both the server and the client.  The only areas where I differ is that I am not using static keys and I am using user authentication.

The CA and certs are working as expected and the client can connect using the username and password.  The issue is that the client will disconnect and reconnect every minute or two and the server sees a new connection, assigns a new IP and after a minute or two, the same thing happens.  Looking through the log file, the only entry that seems related as it happens about the same interval as the dis/reconnects is this:

Error openvpn_client1 event_wait : Interrupted system call (fd=-1,code=4)
As part of my troubleshooting / process of elimination, I performed a "Client Export" from the server and copied the downloaded .ovpn file to my OPNsense client.  Using the openvpn command line:

# openvpn --config filename.ovpn
it connects and stays connected without any dis/reconnects.  So essentially I am using the same openvpn binary executable that OPNsense is using, but something in the client Instance config is causing the dis/reconnects, but eliminating OPNsense and using openvpn directly from the command line works as I would expect.

I have spent hours scouring the web trying to find a solution and searching for the above listed error message, but I have not found anything that actually fixed my issue.

At this point, I don't know what to do as it seems there is something that OPNsense does in how it launches the openvpn client that is causing this.

Any suggestions and help will be greatly appreciated!!

Thanks,

Justin

I've been literally searching for an answer to a similar question for the last 30 minutes. I have setup an instance for client devices to connect to and no matter what device or location it is in it will get disconnected every few minutes and reconnect. I haven't been able to find any answers to this. I have had this issue with v24 and v25.1.


I had already tried what was referenced in that post, did not work for me.  I even set up a new client instance to connect to our main OpenVPN instance that is used regularly, but configured still as a "Legacy" server, and the same problem. 

There is something fundamentally broken with the OPNsense client implementation as I can drop down to the command line and start openvpn with a .ovpn file created by the server and it works perfectly.