You are not logged in.

#1 2025-08-24 05:18:44

dannynexus
Member
Registered: 2025-08-24
Posts: 2

NetworkManager + Sleep = Have to disconnect & reconnect VPN

When my laptop goes to sleep, networkmanager suspends, then when it awakes I have to disconnect and reconnect the vpn it which is quite annoying. I use amneziavpn self hosted with xray protocol and also claude code failed several attempts at providing a fix.

Offline

#2 2025-08-24 07:04:49

-thc
Member
Registered: 2017-03-15
Posts: 1,059

Re: NetworkManager + Sleep = Have to disconnect & reconnect VPN

It depends on the chosen VPN in Amnezia.

OpenVPN depends on an cryptographic context held alive by client and server via startup and (normally) hourly restarts ("ping-restart"). After a suspend/resume event the VPN application has to issue a "ping-restart" to reestablish the context. In my case (nm-openvpn) it tries to do that 3 seconds before the underlying network connection is up and subsequently fails.

WireGuard "only" sets up a local WireGuard interface and doesn't rely an any pre-connection traffic. It works after suspend/resume like nothing happened.

Offline

#3 2025-08-24 07:05:49

dannynexus
Member
Registered: 2025-08-24
Posts: 2

Re: NetworkManager + Sleep = Have to disconnect & reconnect VPN

-thc wrote:

It depends on the chosen VPN in Amnezia.

OpenVPN depends on an cryptographic context held alive by client and server via startup and (normally) hourly restarts ("ping-restart"). After a suspend/resume event the VPN application has to issue a "ping-restart" to reestablish the context. In my case (nm-openvpn) it tries to do that 3 seconds before the underlying network connection is up and subsequently fails.

WireGuard "only" sets up a local WireGuard interface and doesn't rely an any pre-connection traffic. It works after suspend/resume like nothing happened.

I use Xray

Offline

#4 2025-08-24 07:18:19

-thc
Member
Registered: 2017-03-15
Posts: 1,059

Re: NetworkManager + Sleep = Have to disconnect & reconnect VPN

I missed that in your first post - X-Ray is OpenVPN via TCP/HTTPS looking like a legitimate HTTPS request. So the Amnezia App has to issue a "ping-restart".

Offline

Board footer

Powered by FluxBB