Keep-alive does not keep the connection alive

Ivan Labáth labawi-wg at matrix-dream.net
Sun Oct 20 22:25:54 CEST 2019


On Thu, Oct 17, 2019 at 07:03:40PM +0000, Hendrik Friedel wrote:
> >>
> >>  >As a workaround you could
> >>  >   - unconditionally periodically update the endpoint
> >>  This would break existing transfers without reason.
> >
> >As I said, you could try periodically updating the endpoint, and only
> >endpoint, not restarting or changing anything except peer ip+port.
> >If updating endpoint information (to the same or valid ip+port) does break
> >connections, then I believe it is a bug that should be reported.
> 
> I was not able to find commands for updating the endpoint without 
> restarting the tunnel.
> Can you give me a hint?

wg set <interface> [listen-port <port>] [fwmark <mark>] [private-key <file path>] [peer <base64 public key> [remove] [preshared-key <file path>] [endpoint <ip>:<port>] [persistent-keepalive <interval seconds>] [allowed-ips <ip1>/<cidr1>[,<ip2>/<cidr2>]...] ]...

so something like:
wg set <wgiface> peer <peerpubkey> endpoint <ip>:<port>

> >If the server changes IPs and the client remains reachable on previous ip+port,
> >keepalive on server should keep your tunnel alive.
> >
> >
> >Roaming will work if the side that changes ips:
> >   a) has keepalive enabled, so it will send a packet periodically
> >   b) sends an unsolicited packet (e.g. requests something from the
> >      other side as clients usually do but server less so)
> >   c) ip is changed after a request is received and before a reply is
> >      sent (could happen but unreliable)
> >
> 
> I think, there is an 'or' between a, b and c?

Yes, either of those.

--
Ivan


More information about the WireGuard mailing list