Why your VPN keeps disconnecting and how to get a stable connection back

VPN disconnects when idle: which timers to check

Updated:

If your VPN (virtual private network) disconnects after a pause, check the idle timeout and the loss of the connection entry in the router. In the first case, change the auto-disconnect setting; in the second, a keepalive helps: a small periodic packet that keeps the connection alive. Start with the settings of your own profile.

The connection drops while you are transmitting nothing

The idle timeout setting means exactly that: the client deliberately ends an inactive connection. Another mechanism is related to NAT (network address translation): the router keeps a temporary entry for delivering responses to your device. Once it is removed, incoming packets may stop arriving.

What you observePossible causeWhat to check
The client disconnects after a pause and logs itAn explicit idle timerThe auto-disconnect setting in the profile
The status stays the same, but after silence incoming data stops arrivingThe NAT or firewall entry has expiredWhether keepalive is present, and the result of a test with a little traffic

Check the cause step by step:

  1. Identify the client name and protocol in the connection settings.
  2. Measure the time until the drop on an awake device without changing networks.
  3. Look at the log entry at the moment of disconnection.
  4. Repeat the observation with a small amount of regular traffic through the tunnel, for example by periodically refreshing a page.
  5. Compare the result with the profile parameters in the table below.

If the drop disappears with traffic, idleness becomes the more likely cause. But this test does not distinguish the client's timer from the router's timer: traffic can affect both.

If drops occur after screen lock or switching from Wi-Fi to mobile data, use the guide on VPN disconnects on a phone. If the drops are not linked to pauses, start with full VPN disconnection diagnostics.

The router forgets the idle connection

UDP (User Datagram Protocol) sends packets without establishing a connection, but NAT still tracks their exchange.

The standard RFC 4787 requires, with stated exceptions, that UDP translations be kept for at least two minutes, and recommends a default of five minutes or more. Real routers and carrier networks may behave differently. An outbound packet refreshes the timer: a sufficiently frequent keepalive prevents drops caused by entry expiry.

The router forgets the idle connection

The router forgets the idle connectionThe standard RFC 4787 requires, with stated exceptions, that UDP translations be kept for at least two minutes, and recommends a default of five minutes or more. Real routers and carrier networks may behave differently.transmittingnothingthe router keeps atemporary entryOnce it is removedincoming packetsmay stop arriving

The standard RFC 4787 requires, with stated exceptions, that UDP translations be kept for at least two minutes, and recommends a default of five minutes or more.

Real routers and carrier networks may behave differently.

Check keepalive in the client. Do not try to keep the tunnel alive with an endless video: housekeeping packets are enough for this task.

a sufficiently frequent keepalive

a sufficiently frequent keepalivea keepalive helps: a small periodic packet that keeps the connection alive The WireGuard documentation calls 25 seconds a reasonable interval for many firewalls.An outbound packetrefreshes thetimerprevents drops

a keepalive helps: a small periodic packet that keeps the connection alive

The WireGuard documentation calls 25 seconds a reasonable interval for many firewalls.

The router forgets the idle connection

Watch on YouTube

Video: How NAT Works And Why You Should Care · Channel: Naj Qazi

Your profile has several different timers

The idle timeout ends an unused connection. A reachability check shows whether the server responds. Verify what a setting does before changing it. In the table, IKEv2 means the second version of the Internet Key Exchange protocol, which negotiates a secure connection; Always On is Apple's mode in which the VPN connection stays permanently on.

Client or protocolSettingDefaultPurpose
WireGuardPersistentKeepalive0, disabledPeriodic packet to keep the NAT entry alive
OpenVPNkeepalive 10 60This is an example settingOn the client: send a ping every 10 s, restart after 60 s without receiving
OpenVPNping-restart120 s on the client unless the server sent another valueRestart when no response is received
OpenVPNinactive0, disabledExit after the tunnel interface has been idle
Apple IKEv2DisconnectOnIdle0, disabledWhen set to 1, disconnects after DisconnectOnIdleTimer, in seconds
Apple IKEv2DeadPeerDetectionRateMedium, 10 minutesChecks whether the other side is reachable
Apple Always On IKEv2NAT keepalive interval20 s on Wi-Fi, 110 s on cellularKeeps the NAT entry alive
Windows built-in VPNIdleDisconnectSecondsNot specified in the referenceSets the seconds until disconnection when idle

You use WireGuard: the tunnel is silent by default

WireGuard stays silent when there is no data. If a client behind NAT must receive inbound traffic after a pause, the entry needs to be kept alive.

Set PersistentKeepalive = 25 in the [Peer] section of your own profile if testing points to this cause. The WireGuard documentation calls 25 seconds a reasonable interval for many firewalls. If there is no problem, leave it at 0: there is no need to enable the feature just in case.

You use OpenVPN: restart is confused with idle disconnection

On the client, keepalive 10 60 expands into ping 10 and ping-restart 60. These pings do not cancel the auto-disconnect via inactive; the server-side version of the directive doubles the timeout so that the client detects the break first.

Check inactive first, then keepalive and ping-restart. The persist-tun option preserves the virtual network interface across restarts caused by ping-restart, but it does not keep NAT alive. These are settings for OpenVPN 2.6; the app may hide them.

If you use a WireGuard or OpenVPN configuration from the MAX plan of CitadelVPN, open it and check whether the relevant keepalive is present before making changes: a ready-made file does not mean this setting is already in place.

You use the built-in Apple or Windows VPN

In Apple profiles, DPD (dead peer detection) checks the other side. Its standard 10 minutes do not mean disconnection after 10 minutes of inactivity.

Check DisconnectOnIdle in your profile, if available. The NAT keepalive intervals in the table apply to Always On IKEv2, Apple's always-on connection. These keys cannot be transferred to third-party WireGuard clients.

In Windows, Get-VpnConnection shows the built-in profile, and Set-VpnConnection with the -IdleDisconnectSeconds parameter changes the timer. Check the current value: the Microsoft reference does not specify a default. This setting does not apply to standalone VPN apps.

Frequently asked questions about idle disconnections

Why does disconnection happen after exactly the same amount of time?

A repeatable interval strengthens the suspicion of an explicit timer. Measure it from the last traffic through the tunnel: a still mouse does not mean the network is idle, because applications may exchange data in the background.

Won't frequent keepalive drain the battery?

Extra packets can increase energy consumption; Apple explicitly notes this trade-off. If the router keeps the NAT entry longer, a larger interval may be sufficient. Do not set the minimum value unnecessarily.

Can I remove auto-disconnect on a work VPN?

If the profile is managed by an organisation, pass the drop time and log entry to IT. Do not change such a timer or keep the connection alive with artificial traffic to bypass policy.

After testing, change only the setting you need

For a deliberate disconnection, check inactive, DisconnectOnIdle or IdleDisconnectSeconds. For a lost NAT entry, check keepalive; for WireGuard, a sensible starting point is 25 seconds. Change only your own profile, one setting at a time, then repeat the pause in the same network on an awake device. That way you will see which change actually affected the drop.