wg-quick: linux: only touch net.ipv4 for v4
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
cf7ec31d2d
commit
a59aa6c404
1 changed files with 5 additions and 3 deletions
|
@ -194,9 +194,11 @@ add_default() {
|
||||||
cmd ip $proto route add "$1" dev "$INTERFACE" table $table
|
cmd ip $proto route add "$1" dev "$INTERFACE" table $table
|
||||||
cmd ip $proto rule add not fwmark $table table $table
|
cmd ip $proto rule add not fwmark $table table $table
|
||||||
cmd ip $proto rule add table main suppress_prefixlength 0
|
cmd ip $proto rule add table main suppress_prefixlength 0
|
||||||
while read -r key _ value; do
|
if [[ $proto == -4 ]]; then
|
||||||
[[ $value -eq 1 ]] && sysctl -q "$key=2"
|
while read -r key _ value; do
|
||||||
done < <(sysctl -a -r '^net\.ipv4.conf\.[^ .=]+\.rp_filter$')
|
[[ $value -eq 1 ]] && sysctl -q "$key=2"
|
||||||
|
done < <(sysctl -a -r '^net\.ipv4.conf\.[^ .=]+\.rp_filter$')
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue