Error with wg-quick down when IPv6 not present

Brassy Panache brassy.panache at gmail.com
Wed Sep 25 03:06:18 CEST 2019


I have a kernel without IPv6 support.  I've noticed when running:

$ wg-quick down vpn


I receive the following errors:

[#] ip -4 rule delete table 51820
[#] ip -4 rule delete table main suppress_prefixlength 0
RTNETLINK answers: Address family not supported by protocol
Dump terminated
RTNETLINK answers: Address family not supported by protocol
Dump terminated
[#] ip link delete dev vpn
[#] resolvconf -d vpn -f


This is caused by the assumption that the command:

$ ip -6 rule show


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.

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].

In any case, I have attached a patch which I am running locally to avoid
these spurious errors.

[0]:
https://stackoverflow.com/questions/39983121/how-to-detect-if-system-has-ipv6-enabled-in-a-unix-shell-script
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20190925/70b87685/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 927 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20190925/70b87685/attachment.obj>


More information about the WireGuard mailing list