From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: "Jörg Thalheim" <joerg@thalheim.io>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: wg-quick rule bypasses [Was: Re: Announcement: Public Wireguard server for testing]
Date: Sun, 26 Feb 2017 19:28:41 +0100 [thread overview]
Message-ID: <CAHmME9q1-uOmHHCQZR3WcS77MuehH8dLmbMCJKtMrw_mh+im_Q@mail.gmail.com> (raw)
Hey Jorg,
Moving this to a new thread.
On Sun, Feb 26, 2017 at 7:25 PM, J=C3=B6rg Thalheim <joerg@thalheim.io> wro=
te:
> In this context, I found the following rules useful to bypass the vpn for=
some routes:
>
> #!/usr/bin/env bash
> # /etc/wireguard/<profile>.sh
>
> if [ "${1:-down}" =3D "up" ]; then
> action=3D"add"
> else
> action=3D"del"
> fi
>
> ip rule $action priority 32763 to 192.168.0.0/16 lookup main
> ip rule $action priority 32763 to 172.16.0.0/12 lookup main
> ip rule $action priority 32763 to 10.0.0.0/8 lookup main
> ip -6 rule $action priority 32763 to fd::/8 lookup main
> ip -6 rule $action priority 32763 to 2000::/3 unreachable
>
> #/etc/wireguard/<profile>.conf
>
> [Interface]
>
> #....
>
> PostUp=3D/etc/wireguard/<profile>.sh up
> PostDown=3D/etc/wireguard/<profile>.sh down
If any of those routes are already explicitly listed on the main
routing table (more specific than a /0 match), then this will already
happen. This is due to wg-quick's use of suppress_prefix 0.
Jaosn
reply other threads:[~2017-02-26 18:27 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=CAHmME9q1-uOmHHCQZR3WcS77MuehH8dLmbMCJKtMrw_mh+im_Q@mail.gmail.com \
--to=jason@zx2c4.com \
--cc=joerg@thalheim.io \
--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).