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.