Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Baptiste Jonglez <baptiste@bitsofnetworks.org>
To: wireguard@lists.zx2c4.com
Subject: Re: Multiple Endpoints
Date: Sun, 8 Jan 2017 15:12:16 +0100	[thread overview]
Message-ID: <20170108141216.GB6421@tuxmachine.polynome.dn42> (raw)
In-Reply-To: <89477ad4-b015-d0a1-1c05-ea6600b2f464@web.de>

[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]

Hi,

On Sat, Jan 07, 2017 at 03:43:10PM +0100, em12345 wrote:
> I'm wondering how to setup a WG client when having multiple DynDNS names
> for a single WG server using dynamic IP. Using multiple DynDNS services
> for the same host is a common pattern to work around unreliable DynDNS
> services.
> As far as I see, only a single endpoint can be given in the configuration.

I am also interested in multiple endpoints support, and I am preparing a
proposal that I will send soon.

However, in your case, it would not really help.  Actually, even using a
single DynDNS name would not work correctly, because DNS resolution is
done only once by `wg`, when you configure your interface.  Afterwards,
the wireguard kernel module uses the IP address that was provided by `wg`,
not the hostname.  This is similar to the behaviour of iptables, and the
reason is simple: it would be really cumbersome to perform DNS resolution
from kernelspace.

So, if a client is connected to the server and the server changes its IP
address, the client will keep trying to use the old IP address forever.
You would need to destroy the wireguard interface on the client and
recreate it, so that `wg` configures the kernel module with the new IP
address associated with the hostname.

On Sat, Jan 07, 2017 at 05:45:35PM +0100, em12345 wrote:
> On a server IP change:
> 
> - the client still sends UDP packages to old server IP, which is useless
> 
> - the server (from its new IP) can send UDP packages to the still
> remembered client IP (because of PersistentKeepalive). But my
> understanding is that stateful firewalls will block UDP packages from
> the new IP until the client has send an UDP to the new server IP.

For a stateful firewall, this will likely be the case.  However, it would
work with a full-cone NAT:

    https://en.wikipedia.org/wiki/Network_address_translation#Full-cone_NAT

That being said, I'm not an expert on NAT, so I don't know which kind of
NAT is the most widespread.

> So in such a scenario the roaming feature wouldn't help.

You're right, in your case, you would need to setup port forwarding on
your client, so that wireguard on your client device can be reached from
any IP address.

Baptiste

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-01-08 14:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07 14:43 em12345
2017-01-07 15:23 ` Jason A. Donenfeld
2017-01-07 16:45   ` em12345
2017-01-08 14:12     ` Baptiste Jonglez [this message]
2017-01-08 14:39       ` Jörg Thalheim
2017-01-08 21:22         ` Baptiste Jonglez
2017-01-08 22:19         ` Jason A. Donenfeld
2017-01-08 22:18       ` Jason A. Donenfeld
2017-01-08 22:57         ` Baptiste Jonglez
2017-01-08 23:00           ` Jason A. Donenfeld
2017-01-09 11:35             ` Varying source address and stateful firewalls (Was: Multiple Endpoints) Baptiste Jonglez
2017-01-10  4:32               ` Jason A. Donenfeld
2017-01-15 10:01             ` Multiple Endpoints Jason A. Donenfeld
2017-01-08 22:14     ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170108141216.GB6421@tuxmachine.polynome.dn42 \
    --to=baptiste@bitsofnetworks.org \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).