Development discussion of WireGuard
 help / color / mirror / Atom feed
From: jugs <jugs@protonmail.ch>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: WireGuard systemd-networkd routing configuration
Date: Thu, 08 Feb 2018 14:27:16 -0500	[thread overview]
Message-ID: <XIxMOo0l_PgmGyuO-Ox9cPYnHADw82js4MoSGAFj84OReW2Dyj134oZzobkWc4ihQz5Xbnxzh3TZRZdlSYRINw==@protonmail.ch> (raw)

[-- 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 --]

                 reply	other threads:[~2018-02-08 19:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='XIxMOo0l_PgmGyuO-Ox9cPYnHADw82js4MoSGAFj84OReW2Dyj134oZzobkWc4ihQz5Xbnxzh3TZRZdlSYRINw==@protonmail.ch' \
    --to=jugs@protonmail.ch \
    --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).