<div dir="ltr">I've just tested your patch and that works! I no longer see the errors. I don't have a IPv6 environment to test with at the moment, so I cannot verify that case.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 25, 2019 at 7:25 PM Jason A. Donenfeld <<a href="mailto:Jason@zx2c4.com">Jason@zx2c4.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Sep 25, 2019 at 11:06:18AM +1000, Brassy Panache wrote:<br>
> I have a kernel without IPv6 support. I've noticed when running:<br>
> <br>
> $ wg-quick down vpn<br>
> <br>
> <br>
> I receive the following errors:<br>
> <br>
> [#] ip -4 rule delete table 51820<br>
> [#] ip -4 rule delete table main suppress_prefixlength 0<br>
> RTNETLINK answers: Address family not supported by protocol<br>
> Dump terminated<br>
> RTNETLINK answers: Address family not supported by protocol<br>
> Dump terminated<br>
> [#] ip link delete dev vpn<br>
> [#] resolvconf -d vpn -f<br>
> <br>
> <br>
> This is caused by the assumption that the command:<br>
> <br>
> $ ip -6 rule show<br>
> <br>
> <br>
> will run on the system. I have made a change to my local wg-quick script<br>
> which first tests if the command runs successfully before it clears the<br>
> rules. The same should probably also be done prior to running the IPv4<br>
> version of the command.<br>
<br>
Would this work?<br>
<br>
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash<br>
index e690944d..612ecd77 100755<br>
--- a/src/tools/wg-quick/linux.bash<br>
+++ b/src/tools/wg-quick/linux.bash<br>
@@ -102,10 +102,10 @@ del_if() {<br>
while [[ $(ip -4 rule show) == *"from all lookup main suppress_prefixlength 0"* ]]; do<br>
cmd ip -4 rule delete table main suppress_prefixlength 0<br>
done<br>
- while [[ $(ip -6 rule show) == *"lookup $table"* ]]; do<br>
+ while [[ $(ip -6 rule show 2>/dev/null) == *"lookup $table"* ]]; do<br>
cmd ip -6 rule delete table $table<br>
done<br>
- while [[ $(ip -6 rule show) == *"from all lookup main suppress_prefixlength 0"* ]]; do<br>
+ while [[ $(ip -6 rule show 2>/dev/null) == *"from all lookup main suppress_prefixlength 0"* ]]; do<br>
cmd ip -6 rule delete table main suppress_prefixlength 0<br>
done<br>
fi<br>
<br>
</blockquote></div>