wg-quick fails with nftables and IPv6 addresses
Describe your issue
What's the expected behaviour?
wg-quick up works with nftables
What's the current behaviour?
%: sudo wg-quick up wg0-client
[#] ip link add wg0-client type wireguard
[#] wg setconf wg0-client /dev/fd/63
[#] ip -4 address add 10.0.0.4/24 dev wg0-client
[#] ip -6 address add 2a00:xxxx:xxxx:xxxx::4/128 dev wg0-client
[#] ip link set mtu 1420 up dev wg0-client
[#] ip -4 route add 10.0.0.0/8 dev wg0-client
[#] wg set wg0-client fwmark 51820
[#] ip -6 route add ::/0 dev wg0-client table 51820
[#] ip -6 rule add not fwmark 51820 table 51820
[#] ip -6 rule add table main suppress_prefixlength 0
[#] nft -f /dev/fd/63
/dev/fd/63:5:1-129: Error: Could not process rule: No such file or directory
[#] ip -6 rule delete table 51820
[#] ip -6 rule delete table main suppress_prefixlength 0
[#] ip link delete dev wg0-client
content of the file:
add table ip6 wg-quick-wg0-client
add chain ip6 wg-quick-wg0-client preraw { type filter hook prerouting priority -300; }
add chain ip6 wg-quick-wg0-client premangle { type filter hook prerouting priority -150; }
add chain ip6 wg-quick-wg0-client postmangle { type filter hook postrouting priority -150; }
add rule ip6 wg-quick-wg0-client preraw iifname != "wg0-client" ip6 daddr 2a00:xxxx:xxxx:xxxx::4 fib saddr type != local drop
add rule ip6 wg-quick-wg0-client postmangle meta l4proto udp mark 51820 ct mark set mark
add rule ip6 wg-quick-wg0-client premangle meta l4proto udp meta mark set ct mark
the problematic line is:
%: sudo nft --check -f /tmp/tmp.mgbMLA
/tmp/tmp.mgbMLA:5:1-129: Error: Could not process rule: No such file or directory
add rule ip6 wg-quick-wg0-client preraw iifname != "wg0-client" ip6 daddr 2a00:xxxx:xxxx:xxxx::4 fib saddr type != local drop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
How to reproduce your issue?
- install nftables
- configure wireguard to use IPv6
[Interface]
PrivateKey = xxx
Address = 10.0.0.4/24
#Address = 10.0.0.4/24,2a00:xxxx:xxxx:xxxx::4/128
[Peer]
PublicKey = xxxx
Endpoint = IPv4Server:51820
AllowedIPs = 10.0.0.0/8,::/0
PersistentKeepalive = 21
- wg-quick up
What device are you using?
pine64-pinephone (postmarketOS CE 3GB)
On what postmarketOS version did you encounter the issue?
-
edge ( master
branch) -
stable ( v20.05
branch)
How did you get postmarketOS image?
-
from https://images.postmarketos.org -
I built it using pmbootstrap -
It was preinstalled on my device
Additional information
I am using the latest kernel from edge (29. 12. 2020). Using only IPv4 addresses works as expected.