Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Joakim Sindholt <opensource@zhasha.com>
To: Kalin KOZHUHAROV <me.kalin@gmail.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [WireGuard] What is a good way to ingrate (as of now) wireguard into openrc in Gentoo?
Date: Mon, 21 Nov 2016 14:55:06 +0100	[thread overview]
Message-ID: <f4136414.dNq.dMV.2g.oxNfmO@mailjet.com> (raw)
In-Reply-To: <CAKXLc7fAG5xErC_vU40qOwxKxWbLAavKmomNwjOiRP=Fh+0tGg@mail.gmail.com>

On Fri, Nov 18, 2016 at 12:42 PM, Kalin KOZHUHAROV <me.kalin@gmail.com> 
wrote:
> Hello,
> 
> I have been testing a few things between Gentoo and few OpenWRT 
> boxen, so far so good. Just saw that Luci config landed, recompiling 
> now.
> 
> This brings me to "What is a good way to ingrate (as of now) 
> wireguard into openrc in Gentoo?" question.
> 
> I have my scripts, I just found out about 
> /lib64/netifrc/net/wireguard.sh but I couldn't find a way to edit 
> /etc/conf.d/net so that I can integrate it.
> 
> Since Jason is a Gentoo user/dev I thought that is already solved :-D

I'm the idiot who wrote it, not Jason - direct your frustration towards 
me :)

The idea is that the wireguard_$if variable is passed to 'wg set' or 
'wg setconf',
depending on whether or not it's a single argument and a file.
You join this with config_$if which is passed to 'ip address', and 
optionally
routes_$if to create custom routes and 'rules_$if' which is passed to 
'ip rule'.

There are a couple of problems with this - the number I've experienced 
being that
dhcpcd has no respect for network config it didn't create and so it 
will happily
nuke the ip rules every time it renews the dhcp lease.

> An example static config for the simple case of
> 
> host_A:wg0<----->wg0:host_B
> 
> and
> 
>               /-->wg0:host_B
> host_A:wg0<--||
>               \-->wg0:host_C
> 
> (say where A,B,C share some private subnet) will be appreciated.

You can directly follow the terminal examples from eg. the quickstart 
page.
Interface creation is automatic so you just need a 
config_wg0=ip-addr-line and
wireguard_wg0=wg-set-line and you're golden.

> Any good "default" way to store config files? Private keys?

  parent reply	other threads:[~2016-11-21 13:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 11:42 Kalin KOZHUHAROV
2016-11-19  1:14 ` Jason A. Donenfeld
2016-11-21  5:15   ` Kalin KOZHUHAROV
2016-11-21 14:06     ` Joakim Sindholt
2016-11-21 13:55 ` Joakim Sindholt [this message]
2016-11-21 17:00   ` Jason A. Donenfeld

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=f4136414.dNq.dMV.2g.oxNfmO@mailjet.com \
    --to=opensource@zhasha.com \
    --cc=me.kalin@gmail.com \
    --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).