Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Riccardo Paolo Bestetti" <pbl@bestov.io>
To: "Posegga, Joachim" <jp@sec.uni-passau.de>,
	"wireguard@lists.zx2c4.com" <wireguard@lists.zx2c4.com>
Subject: Re: Multiple Clients behind NAT
Date: Thu, 14 Jan 2021 18:09:37 +0100	[thread overview]
Message-ID: <C8J1PKLM140S.1TQXP9KUN0QDH@enhorning> (raw)
In-Reply-To: <f785012b2c5a49c7ba7f48f40b6ce62f@smith.sec.uni-passau.de>

On Wed Jan 13, 2021 at 9:14 PM CET, Posegga, Joachim wrote:
> I am trying to connect multiple wireguard clients behind the same
> NAT-Gateway to a Mikrotik server with a public IP. I am not yet sure
> where exactly the problem is, but it seems that only one client at a
> time can establish a tunnel.

I don't know much about Mikrotik, but my guess is that it's not
randomizing source ports for packets egressing the NAT.

If that's the case, since WireGuard uses the same port for both source
and destination, and since your clients are all connecting to the same
server (and thus port), then your NAT can't demux incoming packets, and
it just sends them all to the same client. (It probably picks the first
one that sends egress packets, until it hits some inactivity time-out).

You should look into your Mikrotik configuration, looking for a flag to
enable source address randomization in NAT (it's sometimes called
"masquerading").

Riccardo


  parent reply	other threads:[~2021-01-14 17:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 20:14 Posegga, Joachim
2021-01-14 10:53 ` Roman Mamedov
2021-01-14 17:09 ` Riccardo Paolo Bestetti [this message]
2021-01-15 14:21   ` Maarten de Vries
2021-01-15 15:22     ` Riccardo Paolo Bestetti
2021-01-15 19:49       ` Posegga, Joachim

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=C8J1PKLM140S.1TQXP9KUN0QDH@enhorning \
    --to=pbl@bestov.io \
    --cc=jp@sec.uni-passau.de \
    --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).