Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Whit Blauvelt <whit@transpect.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: What are the options for stopping and starting?
Date: Mon, 4 Dec 2017 20:36:22 +0100	[thread overview]
Message-ID: <CAHmME9pGZqiKEnjB+6p1-pC+YjMF3KFLUoPAQfhUaCy+mh5=PQ@mail.gmail.com> (raw)
In-Reply-To: <20171204192752.GB5311@black.transpect.com>

On Mon, Dec 4, 2017 at 8:27 PM, Whit Blauvelt <whit@transpect.com> wrote:
> While it's obvious wg-quick is a special purpose script, the precise niche
> it's good for is underspecified; as is the incompatibility of the resulting
> extra lines in the conf files. So if you were going to expand the docs to
> avoid confusing average sysadmins like me, those would be nice things to
> add.

Patches and documentation contributions welcome.

> although wg-quick has some daemonic properties

No, it has exactly zero "daemonic properties". All calls to fork(2)
are quickly followed by either an exec(3) or an _exit(2), and every
child terminates prior to its parent. The parent itself never becomes
a session leader or detaches from its own parent. In other words,
wg-quick is a normal boring bash script.

> It's natural in that metaphor of "service" to ask how to "turn it on" and
> "turn it off." Okay, so "ip link set wg0 down" is the off switch; and "wg
> setconf wg0 wg0.conf" is the on switch?

No. As mentioned before, the reverse of `ip link set wg0 down` is `ip
link set wg0 up`.

> If so, it's just a bit unusual to have the off switch be outside of the
> product (wg), while the on switch is inside it. Each command makes sense;
> having them be so far apart is an unusual placement.

The linux kernel networking stack uses ip(8) and the iproute2 set of
commands as the standard way of configuring the networking state of
the system. The place to complain about this would probably be the
netdev sublist of LKML, but I sincerely doubt you're going to convince
them to change two decades of userspace APIs.

> I respect you're
> adherence to KISS here. Yet an additional option like "wg setconf wg0
> standby" (to set the link down while perserving the options if possible), or
> "wg setconf wg0 off" (to turn it off and lose option settings) would fulfil
> the user's expectation of the on switch and the off switch being found in
> the same place. In a way it simplifies the interface to have features where
> people most naturally look for them.

As has been written prior, `ip link set wg0 up` and `ip link set wg0
down` are what you're looking for.


> Now that I understand it, I've got no problem with it. I'm just pointing out
> that for the next new user, unless the docs further explain this, the same
> confusion could occur.

If you'd like to write an beginner's tutorial to iproute2, and then
add a section on wg(8), be my guest. Probably many people would
benefit.

As was written to you prior, please take additional inquiries to
#wireguard on Freenode where we can help you in real time.

Thanks,
Jason

  reply	other threads:[~2017-12-04 19:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 16:01 Whit Blauvelt
2017-12-04 16:14 ` Jason A. Donenfeld
2017-12-04 17:29   ` Whit Blauvelt
2017-12-04 17:31     ` Aaron Jones
2017-12-04 18:37       ` Whit Blauvelt
2017-12-04 18:49         ` Jason A. Donenfeld
2017-12-04 18:06     ` Jason A. Donenfeld
2017-12-04 19:27       ` Whit Blauvelt
2017-12-04 19:36         ` Jason A. Donenfeld [this message]
2017-12-04 17:00 ` Aaron Jones

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='CAHmME9pGZqiKEnjB+6p1-pC+YjMF3KFLUoPAQfhUaCy+mh5=PQ@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=whit@transpect.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).