Development discussion of WireGuard
 help / color / mirror / Atom feed
* WireGuard systemd-networkd routing configuration
@ 2018-02-08 19:27 jugs
  0 siblings, 0 replies; only message in thread
From: jugs @ 2018-02-08 19:27 UTC (permalink / raw)
  To: WireGuard mailing list

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

Hey guys,

Given WireGuard support is in systemd 237, it may be preferable to have systemd manage the interfaces on some distros.

I'm having issues recreating the routing table with systemd-networkd to do `AllowedIPs=0.0.0.0/0` aka setting the default route for all system traffic to use the wg0 interface. I would appreciate some suggestions on how to change my config to make this happen. I've tried various combinations for the dhcp.network and the wg.network with no success.

Below is my equivalent config as to having my wg.conf with `AllowedIPs=192.168.100.0/24`:

[me@host network]$ pwd
/etc/systemd/network
[me@host network]$ ll
total 12K
-rw-r----- 1 root systemd-network 300 Feb  7 12:00 25-wireguard.netdev
-rw-r----- 1 root systemd-network  60 Feb  7 12:00 40-dhcp.network
-rw-r----- 1 root systemd-network 100 Feb  7 12:00 50-static-wg.network
[me@host network]$ cat 25-wireguard.netdev
[NetDev]
Name=wg0
Kind=wireguard

[WireGuard]
PrivateKey=ABCDEFG=
FwMark=51820

[WireGuardPeer]
PublicKey=GHIJKLMNOP=
AllowedIPs=0.0.0.0/0
Endpoint=1.2.3.4:51820

[me@host network]$ cat 40-dhcp.network
[Match]
Name=eth0

[Network]
DHCP=yes

[DHCP]
UseDNS=no

[me@host network]$ cat 50-static-wg.network
[Match]
Name=wg0

[Network]
Address=192.168.100.2/32
DNS=192.168.100.1

[Route]
Destination=192.168.100.0/24

-jugs

[-- Attachment #2: Type: text/html, Size: 2281 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-08 19:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 19:27 WireGuard systemd-networkd routing configuration jugs

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