[prev in list] [next in list] [prev in thread] [next in thread]
List: wireguard
Subject: wg-quick rule bypasses [Was: Re: Announcement: Public Wireguard server for testing]
From: "Jason A. Donenfeld" <Jason () zx2c4 ! com>
Date: 2017-02-26 18:28:41
Message-ID: CAHmME9q1-uOmHHCQZR3WcS77MuehH8dLmbMCJKtMrw_mh+im_Q () mail ! gmail ! com
[Download RAW message or body]
Hey Jorg,
Moving this to a new thread.
On Sun, Feb 26, 2017 at 7:25 PM, Jörg Thalheim <joerg@thalheim.io> wrote:
> 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}" = "up" ]; then
> action="add"
> else
> action="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=/etc/wireguard/<profile>.sh up
> PostDown=/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
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic