From: "Ivan Labáth" <labawi-wg@matrix-dream.net>
To: Bruno Wolff III <bruno@wolff.to>
Cc: wireguard@lists.zx2c4.com
Subject: Re: [WireGuard] wg set - unexpected change of routes
Date: Tue, 30 Aug 2016 20:27:54 +0100 [thread overview]
Message-ID: <20160830192754.GA18189@matrix-dream.net> (raw)
In-Reply-To: <20160830154439.GA5923@wolff.to>
On Tue, Aug 30, 2016 at 10:44:39AM -0500, Bruno Wolff III wrote:
> On Tue, Aug 30, 2016 at 07:44:54 +0100,
> Ivan Labáth <labawi-wg@matrix-dream.net> wrote:
> >
> >I think repeating subnets in different peers is most probably
> >an error and in such circumstances the most useful action would
> >be to fail and report it as such.
>
> Except in some cases it is convenient to use a large network for one peer
> and carve out a small subnet in another. Having to list a big subnet with
> a carve out as the sum of smaller networks can be a big pain.
By repeating subnets, I meant repeating ip/mask tuples.
It is something that wireguard already enforces, but it
does so by silently dropping all but the last occurence
of the ip+mask.
Currently it will even happily load the following configuration,
dropping the first occurence of the 10/24 subnet:
[Interface]
PrivateKey = mP3lDaGe7Ge/fo1k+TNnBlRVXiZKJSiWfwFrCdcaDGM=
[Peer]
PublicKey = iiLB93qP+YnDqxN4UixSpEWhvqWdZYmcs0fjKRShNmA=
AllowedIPs = 10.0.0.0/16
[Peer]
PublicKey = qAoLCCM/K3JWqaaSdOy2SmuzMTRwTaxyRR3g36tdzgY=
AllowedIPs = 10.0.0.0/16
The following is valid, correctly loaded, as should remain so
(I don't know whether it routes among peers)
[Interface]
PrivateKey = mP3lDaGe7Ge/fo1k+TNnBlRVXiZKJSiWfwFrCdcaDGM=
[Peer]
PublicKey = iiLB93qP+YnDqxN4UixSpEWhvqWdZYmcs0fjKRShNmA=
AllowedIPs = 10.0.0.0/16
[Peer]
PublicKey = qAoLCCM/K3JWqaaSdOy2SmuzMTRwTaxyRR3g36tdzgY=
AllowedIPs = 10.0.0.0/24
I am concerned about situations where one would issue commands
that reuse a route and would not know that a route was removed
from a peer. For example, with the last configuration:
wg set wg0 peer qAoLCCM/K3JWqaaSdOy2SmuzMTRwTaxyRR3g36tdzgY= allowed-ips 10.0.0.0/16
wg set wg0 peer qAoLCCM/K3JWqaaSdOy2SmuzMTRwTaxyRR3g36tdzgY= allowed-ips 10.0.0.0/24
One might think he restored the configuration, but the /16 route was
removed from the first peer.
next prev parent reply other threads:[~2016-08-30 19:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 6:44 [WireGuard] wg set - unexpected change of routes Ivan Labáth
2016-08-30 15:44 ` Bruno Wolff III
2016-08-30 19:27 ` Ivan Labáth [this message]
2016-08-30 19:37 ` Dave Taht
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=20160830192754.GA18189@matrix-dream.net \
--to=labawi-wg@matrix-dream.net \
--cc=bruno@wolff.to \
--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