disabling ipv6 with wg-quick

Greg KH gregkh at linuxfoundation.org
Thu Nov 16 12:22:22 CET 2017


On Thu, Nov 16, 2017 at 11:04:49AM +0100, ds at fastmail.fm wrote:
> Hi,
> 
> Is there a way to disable ipv6 when using wg-quick?
> 
> If I have the following line on my conf file:
> 
> Address = xx.xx.x.39/32,xxxx:xxxx:xxx:bb01::327/128
> 
> wg-quick will fail with the following error:
> 
>  ~ 2   wg-quick up mullvad-se2    
> [#] ip link add mullvad-se2 type wireguard
> [#] wg setconf mullvad-se2 /dev/fd/63
> [#] ip address add  xx.xx.x.39/3 dev mullvad-se2
> [#] ip address add xxxx:xxxx:xxx:bb01::327/128 dev mullvad-se2
> RTNETLINK answers: Permission denied
> 
> I have ip6 disabled in my system.
> 
> Removing xxxx:xxxx:xxx:bb01::327/128 works, but wg-quick still sets ups
> some ipv6 routes `ip -6 ..` etc.
> 
> Is there a way to use ipv4 only with wg-quick?

I placed the following in the [Interface] section of the configuration
file to achieve this:
	PreUp = sysctl net.ipv6.conf.all.disable_ipv6=1
	PostDown = sysctl net.ipv6.conf.all.disable_ipv6=0

It's a horrid hack, but does seem to work.

hope this helps,

greg k-h


More information about the WireGuard mailing list