Development discussion of WireGuard
 help / color / mirror / Atom feed
* wg-quick rule bypasses [Was: Re: Announcement: Public Wireguard server for testing]
@ 2017-02-26 18:28 Jason A. Donenfeld
  0 siblings, 0 replies; only message in thread
From: Jason A. Donenfeld @ 2017-02-26 18:28 UTC (permalink / raw)
  To: Jörg Thalheim; +Cc: WireGuard mailing list

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-26 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-26 18:28 wg-quick rule bypasses [Was: Re: Announcement: Public Wireguard server for testing] Jason A. Donenfeld

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).