From 9d5d4ea0ba1608acb5c506032a677c1450f35189 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 24 Jul 2017 16:08:42 +0200 Subject: wg-quick: do not set explicit src route for v6 default route This was only required because clueless network operators were trying to route fec0::/10 globally, when that range doesn't actually have global scope. Now that we understand the cause was operator error, we revert the change here, so that the routing table is kept consistent. This reverts commit 64e47de870a2f0575b5564a70e5680b48ab83ff9. --- src/tools/wg-quick.bash | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash index ff92221..b1fb435 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick.bash @@ -144,18 +144,10 @@ add_default() { ((DEFAULT_TABLE++)) done fi - local proto=-4 src ip - if [[ $1 == *:* ]]; then - proto=-6 - for ip in "${ADDRESSES[@]}"; do - if [[ $ip == *:* ]]; then - src="src ${ip%/*}" - break - fi - done - fi + local proto=-4 + [[ $1 == *:* ]] && proto=-6 cmd wg set "$INTERFACE" fwmark $DEFAULT_TABLE - cmd ip $proto route add "$1" $src dev "$INTERFACE" table $DEFAULT_TABLE + cmd ip $proto route add "$1" dev "$INTERFACE" table $DEFAULT_TABLE cmd ip $proto rule add not fwmark $DEFAULT_TABLE table $DEFAULT_TABLE cmd ip $proto rule add table main suppress_prefixlength 0 local key value -- cgit v1.2.3-59-g8ed1b