I broke ipv6 setting again

I got rid of manually configing ipv6. Yes, slaac works, dhcpv6 works as first. Every clients that support dhvpv6 got a 3h lease, but I configed IPv6 Prefix Lifetime to be 7 day. After 3h, clients will only have slaac address :disappointed_face:. But if I restart one of the client, it wiil get a dhcpv6 address again. After restart router, I have to restart clients to get new dhcpv6 address again. Does it has something to do with odhcpd-ipv6only or dnsmasq-full?

/etc/config/network

config interface 'loopback'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'
        option device 'lo'

config globals 'globals'
        option ula_prefix 'fd0c:2f7a:4c96::/48'
        option packet_steering '1'

config interface 'lan'
        option proto 'static'
        option device 'eth1'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '64'
        option ip6ifaceid '::1'

config interface 'lab'
        option proto 'static'
        option device 'eth2'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option defaultroute '0'
        option delegate '0'
        option ipv6 '0'

config device
        option name 'eth2'
        option ipv6 '0'

config interface 'wan'
        option device 'eth0'
        option proto 'pppoe'
        option username '****'
        option password '****'
        option ipv6 'auto'
        option ip6ifaceid 'random'

/etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '50'
        option limit '200'
        option leasetime '3h'
        option dhcpv4 'server'
        option ra 'server'
        option dhcpv6 'server'
        option preferred_lifetime '7d'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config dhcp 'lab'
        option interface 'lab'
        option start '100'
        option limit '150'
        option leasetime '3h'
        option dhcpv6 'ignore'

/etc/config/firewall

config defaults
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config zone
        option name 'lab'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        list network 'lab'

config forwarding
        option src 'lab'
        option dest 'wan'

Try this set :

option preferred_lifetime

To the same as

I followed your instruction, but I need 3h to verify whether it will work.

1 Like

Do you run 24.10 or a snapshot? There have been many changes in snapshots related to odhcpd and odhcp6c that may affect your current config (some odhcpd parameters were changed, or replaced with new ones).

A openwrt 24.10 incus container.

1 Like

This is now called max_preferred_lifetime, even in 24.10.4. It defaults to 45m if unset.

It shows in /etc/config/network after I configed IPv6 Prefix Lifetime via luci.

Well, I deleted a fixed IP address via luci, and openwrt released all dhcpv6 lease. I guess it works, I don't want to wait another 3h. I will wait for one more day to see whether it really works.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.