Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Yousong Zhou <yszhou4tech@gmail.com>
To: vtol@gmx.net
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: wg-quick (script snippets) for OpenWRT/LEDE
Date: Mon, 9 Apr 2018 11:05:22 +0800	[thread overview]
Message-ID: <CAECwjAiNAYPBTQ=5+_2aVSvgvU5eKOx2b4-3JTbxSiP4mbnkeA@mail.gmail.com> (raw)
In-Reply-To: <trinity-d392f714-af63-4df5-a7bf-3bc24d3edf34-1522768786475@3c-app-gmx-bs64>

On 3 April 2018 at 23:19,  <vtol@gmx.net> wrote:
> Hi,
>
> it appears that wg-quick is not provided for OpenWRT/LEDE.
>
> The reason is not really clear to me. As far I understand wg-quick depends
> on BASH whilst the default shell in OpenWRT/LEDE is ASH.
> This however can be easily remidied by installing the BASH package from the
> OpenWRT/LEDE repo.
>
> OpenWRT/LEDE is utilising netifd for network configuration which is lacking
> th3 versatility of wg-quick with there script snippets
>
> PRE_UP=( )
> POST_UP=( )
> PRE_DOWN=( )
> POST_DOWN=( )
>

POST_UP and POST_DOWN is possible with hotplug scripts in OpenWrt, but
the PRE_xx callback is currently not possible.  As a temporary
workaround, you can try patching locally /lib/netifd/proto/wg.sh to
achieve similar effects, or wrapping wg command with a script (hacky
wacky way)

> Is there a way to get those script snippets working in OpenWRT/LEDE as such
> is required in dynamic/split/kill-switch routing scenarios.
>

Just try installing all those dependencies wg-quick requires, though
after you know enough details about the wg-quick script, you may well
just write your own stripped down version for your own needs.

> OpenVPN provides a similar script functionality which is however not
> stripped on the OpenWRT/LEDE repo, respectively it does not require an extra
> tool package. I find it rather curious that the aforementioned script
> snippets are not part of wg but rather implemented in wg-quick which then is
> absent from OpenWRT/LEDE.
>

OpenVPN and WireGuard is different in this regard.  OpenVPN has a
daemon running while WireGuard depends on the network manager to do
the maintenance things.

                yousong

  parent reply	other threads:[~2018-04-09  2:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 15:19 vtol
2018-04-03 15:25 ` Aw: " vtol
2018-04-09  3:05 ` Yousong Zhou [this message]
2018-04-03 16:33 vtol
2018-04-08 20:45 ` ѽ҉ᶬḳ℠
2018-04-13 22:34 ` 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='CAECwjAiNAYPBTQ=5+_2aVSvgvU5eKOx2b4-3JTbxSiP4mbnkeA@mail.gmail.com' \
    --to=yszhou4tech@gmail.com \
    --cc=vtol@gmx.net \
    --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).