Keep-alive does not keep the connection alive

Hendrik Friedel hendrik at
Wed Aug 28 08:25:15 CEST 2019


that seems not to be the intended behaviour:
If I understand correctly, the current behaviour is:

At tunnel start the IP is resolved
This IP is used for ever, namingly for re-connects.

The probably intended behaviour would be:

At tunnel start and at any re-connect the IP is resolved.

Do you agree that this behaviour should be changed?
Apart from that: Can you suggest an automatable workaround?


------ Originalnachricht ------
Von: "Laszlo KERTESZ" <laszlo.kertesz at>
An: "Ivan Labáth" <labawi-wg at>
Cc: "Hendrik Friedel" <hendrik at>; wireguard at
Gesendet: 28.08.2019 08:17:32
Betreff: Re: Keep-alive does not keep the connection alive

>I too use a server with dynamic ip. And the clients (Android, Linux) 
>tend to lose connectivity permanently if the server's ip changes. With 
>or without keepalive.
>The dynamic ip's dns entries are updated almost instantly when the ip 
>changes so this is not dns related. Wireguard does not try to re 
>establish connection, it keeps using the server ip acquired at the 
>tunnel's start. Only way around this is restarting the interface.
>On Mon, Aug 26, 2019, 21:08 Ivan Labáth <labawi-wg at> 
>>I notice you are using dynamic ips for server.
>>On the client, is the server peer ip correct?
>>On Sun, Aug 25, 2019 at 06:44:53PM +0000, Hendrik Friedel wrote:
>> > Hello,
>> >
>> > thanks for your reply.
>> > It is linux (Kernel 5.x) in both cases.
>> >
>> > Regards,
>> > Hendrik
>> >
>> > ------ Originalnachricht ------
>> > Von: "Vasili Pupkin" <diggest at>
>> > An: "Hendrik Friedel" <hendrik at>
>> > Cc: wireguard at
>> > Gesendet: 25.08.2019 17:59:59
>> > Betreff: Re: Keep-alive does not keep the connection alive
>> >
>> > >What OS is running on client side? I have this issue on Win7 
>> > >can explain it further, it has nothing to do with keepalives 
>> > >it is a bug in tun adapter implementation
>> > >
>> > >On Sun, Aug 25, 2019 at 6:38 PM Hendrik Friedel 
>><hendrik at> wrote:
>> > >>  I have a setup in which the Server IP is known, whereas the 
>>Client IP is changing. Thus, I rely on the Client to connect to the 
>>Server. I want the Client to keep the connection alive all the time 
>>though, so that the Server can also initiate a connection to the 
>>Server when needed. Both, client and server are behind a NAT/Router.
>> > >>  I would think, that the "PersistentKeepalive = 25" on the Client 
>>would ckeep the connection open. The connection works fine while used. 
>>But after a while, I cannot connect from the Server to the client 
>> > >>  I would assume that a ping from the Client to the IP of the 
>>endpoint would help to re-alive the connection - but it does not.
>> > >>
>> > >>  Only after a wg-quick down and up all is fine again.
>> > >>
>> > >>  Below some more information.
>> > >>
>> > >>  Can you help me to find, what I am doing wrong?
>> >
>> > _______________________________________________
>> > WireGuard mailing list
>> > WireGuard at
>> >
>>WireGuard mailing list
>>WireGuard at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the WireGuard mailing list