OPNsense Forum

English Forums => Virtual private networks => Topic started by: giox969 on May 07, 2025, 11:03:45 PM

Title: OpenVPN sessions remain active after client disconnect
Post by: giox969 on May 07, 2025, 11:03:45 PM
Hello!

I'm new to OPNsense, having just migrated from pfSense. I'm currently using OPNsense 25.1.5_5-amd64.

I've configured an OpenVPN server in "VPN: OpenVPN: Instances" and downloaded the .ovpn file from "VPN: OpenVPN: Client Export." I've also configured the necessary firewall rules.
The connection works properly - I can successfully reach all internal PCs on the LAN. However, I'm experiencing an issue: when I disconnect the client, the connection is never removed from the Connection Status list on the OPNsense side. The IP address is not released, and the route to the client is not removed.

Since the client disconnects every two minutes due to "Inactivity timeout (--ping-restart)" when there's no traffic, the list of active sessions on the server side grows indefinitely.

What am I doing wrong? Why aren't connections being released on the server side?

Thank you.
Title: Re: OpenVPN sessions remain active after client disconnect
Post by: giox969 on May 28, 2025, 09:34:01 PM
Ok, half answer found: to avoid clients restarting every two minutes, in the openvpn server instance editor, enable advanced mode and set "Keep alive interval" to 10, and "Keep alive timeout" to 60.
Another useful option to mitigate IP wasting after reconnection, is to enable explicit-exit-notify in both Push Options and Options.