I have a WireGuard VPN server running. How do I set a timeout so that connected clients will get disconnected if they are idle for the given time (or maybe even disconnection irrespective of being idle or not)? Where do I specify this parameter, I see no mention of it in the Wire Guard Documentation.

1 Answer 1


There is no such parameter in WireGuard as, clients can go quiet at any time and expect to be able to talk to the server again at any time later.

Specifically, the protocol requires a client to handshake with the server to begin a session. To maintain the session a client must handshake at least once every 180 seconds. In practice, the handshake happens some time between 120 and 180 seconds.

If a client stops talking and at a later time wants to start talking again, providing the server is active then,if the time since last talking is:

  • <120 seconds, carry on as normal
  • >=120 seconds, <=180 seconds carry on and handshake within 60 seconds.
  • > 180 seconds, handshake and carry on

The server and client maintain timers so that they always know what to do and when to do it.

Thus, WireGuard is a connectionless protocol and there is no need to worry about timeouts. A client is either talking (and handshaking as required) or silent.

  • 1
    Great info thanks! I still would like to enforce a timeout on top of this. Is there any workaround or tool to do this? Dec 10, 2020 at 15:32
  • I don't understand what you don't understand about there being no such option.
    – user9517
    Dec 10, 2020 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.