jordanpotter / docker-wireguard

Simple image for running a WireGuard client with a kill switch
MIT License
143 stars 37 forks source link

Only set ipv6 killswitch if ipv6 interface exists #4

Closed bobbypage closed 4 years ago

jordanpotter commented 4 years ago

From https://github.com/jordanpotter/docker-wireguard/pull/3#discussion_r487465459, it sounds like this change was required because your Docker setup doesn't have ipv6 support. Strangely, mine doesn't have ipv6 configured either, but I never needed this change 🤔

Would you mind including the error you saw?

bobbypage commented 4 years ago

This was the error I was hitting without this change:

$ sudo docker run --name wireguard --cap-add NET_ADMIN --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v $(pwd)/config/mullvad/mullvad-ca10-ipv4.conf:/etc/wireguard/mullvad.conf bobbypage/docker-wireguard:latest
[#] ip link add mullvad type wireguard
[#] wg setconf mullvad /dev/fd/63
[#] ip -4 address add<redacted> dev mullvad
[#] ip link set mtu 1420 up dev mullvad
[#] resolvconf -a mullvad -m 0 -x
[#] wg set mullvad fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev mullvad table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
skipping setting net.ipv4.conf.all.src_valid_mark
[#] echo skipping setting net.ipv4.conf.all.src_valid_mark
[#] iptables-restore -n
ip6tables v1.8.4 (legacy): Couldn't load match `addrtype':No such file or directory
jordanpotter commented 4 years ago

Thanks again @bobbypage!!