wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
* FYI: systemd's networkd (v242) incorrectly setting listen-port on wg interface
@ 2019-09-02 19:26 David Anderson
  2019-09-02 19:42 ` David Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: David Anderson @ 2019-09-02 19:26 UTC (permalink / raw)
  To: WireGuard mailing list

Posting here for posterity, in case someone else encounters this problem.

In systemd v242, networkd has a bug
(https://github.com/systemd/systemd/issues/12377), in which it ignores
the `ListenPort` directive in its config files for wireguard
interfaces. The results is that even if you specify ListenPort=51820,
when you restart networkd it'll assign a random listening port to the
wg interface.

This can lead to some frustrating debugging where your VPN
mysteriously doesn't come up, and it turns out to be because your
wireguard server is listening on entirely the wrong port. You fix it
with `wg set wg0 listen-port 51820` after networkd has started.

Because of systemd's "no patch releases" release cycle, this seems to
have been broken since 11 Apr for any distro using an unmodified v242
systemd. I discovered this on Debian Buster (the newest "stable").
Looks like the fix was pulled into at least NixOS and Gentoo, not sure
about other distros. v243 has the fix, and should be releasing Any
Time Now.

I'm going to file a Debian bug to request a backport of this patch,
since I'm guessing they're not going to be upgrading systemd routinely
on the stable track. Hopefully it won't bite too many people though,
since networkd isn't the default for network configuration on Buster
(I'm just an enthusiastic early adopter).

- Dave
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-02 23:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02 19:26 FYI: systemd's networkd (v242) incorrectly setting listen-port on wg interface David Anderson
2019-09-02 19:42 ` David Anderson
2019-09-02 22:41   ` Georg Faerber
2019-09-02 22:46     ` David Anderson
2019-09-02 22:51       ` Georg Faerber
2019-09-02 23:25   ` David Anderson

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).