Dual-stack configuration leads to DHCP not assigned ipv4 when internet connection is interupted and router was restarted

I have a setup, where I get an ipv4 and ipv6 from my ISP.

When the WAN is connected my router gets both IPs and any client connected to it gets both IPs assigned by DHCP as well. All is working as expected.
(my clients get a non public ipv6, but that is on purpose (dhcpv6 is set to server mode instead of relay mode))

If I now disconnect my WAN connection and restart the router, clients only get an IPv6 assigned by the DHCP, no IPv4. When I manually set an IPv4 on the client the router can normally be reached.
If I only disconnect WAN without restarting, this seems not to happena nd both v4 & v6 are still served.

So now I am wondering, why odhcpd is dependant on a WAN connection to serve ipv4 addresses? Has anyone else faced this before?

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

ubus call system board

{
        "kernel": "5.15.150",
        "hostname": "OpenWrt-Router",
        "system": "MediaTek MT7620A ver:2 eco:6",
        "model": "TP-Link Archer C50 v1",
        "board_name": "tplink,archer-c50-v1",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.3",
                "revision": "r23809-234f1a2efa",
                "target": "ramips/mt7620",
                "description": "OpenWrt 23.05.3 r23809-234f1a2efa"
        }
}

But I have also tested the same with an Asus RT-AX53U

cat /etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd6c:xxx::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'
        option stp '1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ip6assign '64'
        option ip6hint '10'
        option delegate '0'
        list ipaddr '192.168.10.1/24'

config device
        option name 'eth0.2'
        option macaddr 'xxx'

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'
        option peerdns '0'
        list dns '185.150.99.255'
        list dns '5.9.164.112'

config interface 'wan6'
        option device 'eth0.2'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix '60'
        option peerdns '0'
        list dns '2001:678:ed0:f000::'
        list dns '2a01:4f8:251:554::2'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 6t'
        option vid '1'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0 6t'
        option vid '2'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option vid '41'
        option ports '1t 6t'

config interface 'IOT'
        option proto 'static'
        option ipaddr '192.168.41.1'
        option netmask '255.255.255.0'
        option type 'bridge'
        option device 'iot-br'
        option delegate '0'

config device
        option type 'bridge'
        option name 'iot-br'
        list ports 'eth0.41'
        option stp '1'

config route
        option target '10.0.10.0/24'
        option gateway '192.168.10.21'
        option interface 'lan'
        option disabled '1'

config route
        option interface 'lan'
        option target '192.168.11.0/24'
        option gateway '192.168.10.21'

config route
        option interface 'lan'
        option target '192.168.42.0/24'
        option gateway '192.168.10.21'

config route
        option interface 'IOT'
        option target '192.168.42.0/24'
        option gateway '192.168.10.21'
        option disabled '1'

config route
        option interface 'lan'
        option target '192.168.20.0/24'
        option gateway '192.168.10.21'

config route
        option interface 'lan'
        option target '192.168.9.0/24'
        option gateway '192.168.10.21'

cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option txpower '22'
        option country 'DE'
        option cell_density '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'xxx-5'
        option ifname 'wlan5'
        option encryption 'psk2+ccmp'
        option key 'xxx'
        option wpa_disable_eapol_key_retries '1'
        option ieee80211r '1'
        option mobility_domain '7195'
        option ft_over_ds '0'
        option ft_psk_generate_local '1'
        option dtim_period '3'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/10180000.wmac'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option country 'DE'
        option cell_density '0'
        option txpower '20'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'xxx-2.4'
        option ifname 'wlan2'
        option encryption 'psk2+ccmp'
        option key 'xxx'
        option wpa_disable_eapol_key_retries '1'
        option ieee80211r '1'
        option mobility_domain '7196'
        option ft_over_ds '0'
        option ft_psk_generate_local '1'
        option dtim_period '3'

config wifi-iface 'wifinet5'
        option device 'radio1'
        option mode 'ap'
        option ssid 'xxx'
        option hidden '1'
        option ieee80211w '0'
        option wpa_disable_eapol_key_retries '1'
        option key 'xxx'
        option encryption 'psk2+ccmp'
        option network 'IOT'
        option isolate '1'

config wifi-iface 'wifinet4'
        option device 'radio1'
        option mode 'ap'
        option ssid 'xxx'
        option encryption 'sae'
        option wds '1'
        option hidden '1'
        option ifname 'wds2'
        option key 'xxx'
        option network 'lan'
        option wpa_disable_eapol_key_retries '1'

I was however using LAN and not WIFI for the described tests above

cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option expandhosts '1'
        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'
        option local '/lan/'
        option domain 'lan'
        option strictorder '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option dhcpv4 'server'
        option leasetime '12h'
        list dhcp_option '6,192.168.10.23,192.168.10.1'
        option ra 'server'
        option dhcpv6 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

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

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config dhcp 'IOT'
        option interface 'IOT'
        option start '100'
        option limit '150'
        option leasetime '12h'

192.168.10.23 is a Pi-hole, hence the DHCP option 6

cat /etc/config/firewall

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

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

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

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 src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        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 include
        option path '/etc/firewall.user'

config redirect
        option dest 'lan'
        option target 'DNAT'
        list proto 'udp'
        option src 'wan'
        option src_dport '51234'
        option dest_ip '192.168.10.20'
        option dest_port '51234'
        option name 'xxx'

config redirect
        option dest 'lan'
        option target 'DNAT'
        option name 'xxx'
        option src 'wan'
        option src_dport '51231'
        option dest_ip '192.168.10.21'
        option dest_port '51231'
        list proto 'udp'

config zone
        option name 'iot'
        option output 'ACCEPT'
        option forward 'REJECT'
        list network 'IOT'
        option input 'REJECT'

config rule
        option name 'IOT DNS'
        option family 'ipv4'
        option src 'iot'
        option dest_port '53'
        option target 'ACCEPT'

config rule
        option name 'IOT DHCP'
        option family 'ipv4'
        list proto 'udp'
        option src 'iot'
        option dest_port '67'
        option target 'ACCEPT'

config forwarding
        option src 'lan'
        option dest 'iot'

config forwarding
        option src 'iot'
        option dest 'wan'

config redirect
        option dest 'lan'
        option target 'DNAT'
        option name 'xxx'
        list proto 'udp'
        option src 'wan'
        option src_dport '51441'
        option dest_ip '192.168.10.21'
        option dest_port '51441'

The port forwards are for 3 different Wireguard tunnels