aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xsrc/tools/wg-quick.bash14
1 files 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