<div dir="ltr"><div>I have a kernel without IPv6 support.  I've noticed when running:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>$ wg-quick down vpn</div></blockquote><br></div><div>I receive the following errors:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>[#] 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></div></blockquote><br></div><div>This is caused by the assumption that the command:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">$ ip -6 rule show<br></blockquote><br></div><div>will run on the system.  I have made a change to my local wg-quick script which first tests if the command runs successfully before it clears the rules.  The same should probably also be done prior to running the IPv4 version of the command.</div><div><br></div><div>An alternate approach could also be to check that IPv6 is available in the running kernel, but there didn't seem to be a reliable cross-platform mechanism to do that [0].</div><div><br></div><div>In any case, I have attached a patch which I am running locally to avoid these spurious errors.</div><div><br></div><div>[0]: <a href="https://stackoverflow.com/questions/39983121/how-to-detect-if-system-has-ipv6-enabled-in-a-unix-shell-script">https://stackoverflow.com/questions/39983121/how-to-detect-if-system-has-ipv6-enabled-in-a-unix-shell-script</a></div></div>