Can't set static IPv6 address on LAN

I recently upgraded from OpenWRT 19 to 21, and since it required me to wipe my router anyway, I upgraded my router and started from scratch. Unfortunately, I can't seem to recreate my previously working IPv6 configuration.

My main problem is that I can't seem to assign the router an IPv6 address on the local lan interface. After I create the lan interface, the options to set the IPv6 address appear the very first time, but then disappear from the Interfaces > Edit > General page after that. It does work temporarily if I edit /etc/config/network, manually add list ip6addr xxx::1/64, and /etc/init.d/network restart. However, this seems to get removed from the configuration file later on when I do anything through luci. I have luci-proto-ipv6 installed, and I do see IPv6 address options for 6in4 interfaces. I also have odhcpd-ipv6only installed--I know the documentation says I need odhcpd, but since I'm only using it for IPv6 route advertisements, I assume that's okay.

I should note that the router itself can access IPv6 without any problem, and if I manually force it to have an address, it temporarily works. Hence, I know I have the right addresses and so forth. Here is what my configuration looks like right now, though I've tried many variants of this:

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr ''
	option netmask ''
	option ip6assign '60'
	option ip6hint '0000'
	list ip6class 'wan6'
	option force_link '0'
	option defaultroute '0'
	option ip6ifaceid '::1'

config interface 'wan6'
	option proto '6in4'
	option ip6addr 'MY-WAN-ADDR/64'
	list ip6prefix 'MY-NETWORK::/48'
	option ip6assign '64'
	option delegate '0'
	# peer details ...

I think what's going on is that OpenWRT wants me to use prefix delegation or something, but I don't have any kind of upstream DHCPv6 server, I just have a statically assigned /48. So the static address I want is MY-NETWORK::1/64. It would be a bonus if I could also use MY-NETWORK:10::1/64 for my guest network, which is what I'm trying to do by setting the ip6hint to 0000, but frankly at this point I'd be happy just to have IPv6 working on my main lan network.

For what it's worth, this is in /etc/config/dhcp:

config dhcp 'lan'
	option interface 'lan'
	option leasetime '12h'
	option start '512'
	option limit '64512'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option ra 'server'

config dhcp 'wan6'
	option interface 'wan6'
	option ignore '1'
	list ra_flags 'none'

Thanks for any explanations of what I'm doing wrong, or suggestions for fixing it.

Well, somehow setting option delegate '0' on the wan6 interface was preventing luci from showing the IPv6 address entry fields on lan. By checking the "Delegate IPv6 prefixes" box in the wan6 advanced interface configuration page, I briefly got the IPv6 entry to show up on lan again. Then I deleted the IPv6 address I had and the entry box disappeared, but I don't need it any more because now it uses the hint and does the delegation automatically.

LuCI will disable manual IPv6 address options if ip6assign is used.

1 Like