Article View: comp.misc
Article #194Re: Keeping An OpenVPN Connection Alive
From: Theo
Date: Thu, 26 Nov 2026 11:51
Date: Thu, 26 Nov 2026 11:51
33 lines
2562 bytes
2562 bytes
Lawrence D’Oliveiro <ldo@nz.invalid> wrote: > I just had them running overnight at one ping a minute, and both > worked without a hiccup. So I stopped them and restarted this morning > with a ping frequency of once in 5 minutes, and already I was getting > lost packets to my VPS, while the client connection remained fine. > > Now I have the frequency at one ping every 2½ minutes, and both are > back to working OK. This points to some kind of timeout happening on > the link to the VPS, with an expiry somewhere between 2½ and 5 > minutes. Are you on (CG)NAT by any chance? It looks like the TCP connection is timing out, which is common if you're going through a NAT box (it wants to keep the size of its NAT tables under control). Look at the 'keepalive' option in your OpenVPN config, which will send idle messages in the socket to keep this from happening. > Looking the sort of errors logged, they say things like “TLS ERROR: > local/remote key IDs out of sync” and “TLS Error: TLS key negotiation > failed to occur within 60 seconds (check your network connectivity)”. > > Keys getting out of sync is a peculiar one -- does that sound like > spurious packets coming in from some other source, that look like they > are coming from me? It sounds like rekeying isn't working, but I'm surprised that's happening on connection idle - I'd expect it to be every 60/whatever minutes irrespective of connection busyness. Are you sure these are co-incident with the dropouts? Or maybe the above are just fallout from the network dropping your socket but OpenVPN not noticing that directly? Theo
Technical Details
Message-ID:
<5uC*wDGWA@news.chiark.greenend.org.uk>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!newsfeed.xs3.de!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mailReferences:
<11e7nh4$6089$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!newsfeed.xs3.de!nntp-feed.chiark.greenend.org.uk!ewrotcd!.POSTED.chiark.greenend.org.uk!not-for-mail
From: Theo <theom+news@chiark.greenend.org.uk>
Newsgroups: comp.misc
Subject: Re: Keeping An OpenVPN Connection Alive
Date: 26 Nov 2026 11:51:53 +0000 (GMT)
Organization: University of Cambridge, England
Message-ID: <5uC*wDGWA@news.chiark.greenend.org.uk>
References: <11e7nh4$6089$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: chiark.greenend.org.uk; posting-host="chiark.greenend.org.uk:93.93.131.173";
logging-data="460"; mail-complaints-to="abuse@chiark.greenend.org.uk"
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-44-amd64 (x86_64))
Originator: theom@chiark.greenend.org.uk ([93.93.131.173])