DHCPv6 Client WAN6 cannot work out-of-box on OpenWrt (sysctl issue)

Looks like as of OpenWrt 22.03.3, for some reasons the router can't get IPv6 address on the WAN/WAN6 interface via DHCPv6 because of this questionable sysctl setting, especially when using DHCP for IPv4 WAN.

net.ipv6.conf.eth0.2.disable_ipv6 = 1

On some routers eth0.2 is the WAN interface. I wonder what is the rationale behind disabling ipv6 capabilities on WAN (actually, VLAN interfaces in general).

A while ago I was struggling to figure out why my OpenWrt router cannot obtain an IPv6 address from my main router via DHCPv6 no matter how I configured it. After some intensive googling I found this writing which turned out to be the case for my router. According to the writing I referenced:

It seems like the OpenWRT kernel might be automatically disabling IPv6 support on any VLAN-ed interface. Who knows why. Perhaps my configuration isn’t quite standard, though I don’t see how.

After setting that sysctl variable to 0, the router could then get a usable IPv6 address on WAN6 after restarting the interface. Problem solved. However, by default this won't survive reboots so I'm experimenting with putting this change into a config file in /etc/sysctl.d to see if it would retain this setting after router reboot or upgrade.

Again, per the writing I referenced, this issue has been around for quite a while and someone already posted about it before.

PS: This doesn't affect PPPoE users, as when using PPPoE an interface named pppoe-wan will be created, which is not affected by this problem and can use IPv6 just fine. Bridges (namely br-lan) are also not affected, so it may be possible to work around the issue by putting the WAN interface behind a bridge just like the LAN interfaces.

Works out-of-the-box here for a device with eth0.2 as WAN.

root@OpenWrt:~# sysctl net.ipv6.conf.eth0.2.disable_ipv6
net.ipv6.conf.eth0/2.disable_ipv6 = 0
1 Like

I have eth0.2 as wan,
and the value is properly 0 by default,
and I do get native IPv6 from ISP quite normally.

Are you running the official release build, or a private build compiled by somebody?

2 Likes

The sysctls are disabled to push the IPv6 handling and -policy making into userspace, to odhcpd - that shouldn't be a problem.

1 Like

I build my own image via official ImageBuilder. The device is a Zyxel NBG6817 (ipq806x).

Just that I'm not sure why the router is disabling VLAN interfaces here.

Unlike my another OpenWrt router (Linksys WRT3200ACM, mvebu), this one doesn't appear to be DSA capable and I still have to configure VLANs the old, classic way.

EDIT: I don't think I'm using odhcpd... I'm currently using dnsmasq-full instead of dnsmasq, as some features depended on this. Also, when building images, dnsmasq needs to be explicitly excluded in order to allow dnsmasq-full to be added as they are mutually exclusive.