Unfortunately, the issue happened again, and I again did not have time to troubleshoot it.
Same symptoms: a specific device is not getting an IP via DHCP anymore, rebooting this openwrt machine immediately fixes the issue.
I also just removed (after rebooting) the three lines mentioned above from /etc/config/dhcp
and after /etc/init.d/dnsmasq restart
I got udhcpc: no lease, failing
.
Config is now, just for reference:
/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 'fd68:c0fd:f8dc::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
list ports 'eth1'
list ports 'eth2'
list ports 'eth3'
config interface 'lan'
option device 'br-lan.1001'
option proto 'dhcp'
option delegate '0'
config interface 'mgmt'
option proto 'static'
option device 'eth4'
option ipaddr '192.168.200.1'
option broadcast '192.168.200.255'
list ip6addr 'fd00:200::'
option ip6gw 'fd00:200::'
option netmask '255.255.255.0'
config bridge-vlan
option device 'br-lan'
option vlan '1001'
list ports 'eth0:u*'
list ports 'eth1:u*'
list ports 'eth2:u*'
list ports 'eth3:t'
config interface 'guestwifi'
option proto 'none'
option device 'br-lan.1010'
config interface 'lan6'
option proto 'dhcpv6'
option device 'br-lan.1001'
option reqaddress 'try'
option reqprefix 'auto'
config bridge-vlan
option device 'br-lan'
option vlan '1010'
list ports 'eth0:t'
list ports 'eth1:t'
list ports 'eth2:t'
list ports 'eth3:t'
/etc/init.d/firewall
#!/bin/sh /etc/rc.common
START=19
USE_PROCD=1
QUIET=""
service_triggers() {
procd_add_reload_trigger firewall
}
restart() {
fw4 restart
}
start_service() {
fw4 ${QUIET} start
}
stop_service() {
fw4 flush
}
reload_service() {
fw4 reload
}
boot() {
# Be silent on boot, firewall might be started by hotplug already,
# so don't complain in syslog.
QUIET=-q
start
}
/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 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 '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ra 'relay'
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 'mgmt'
option interface 'mgmt'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv6 'server'
list dns 'fd00:1::1'
list dns '2a02:8106:65:8400::1'
The switch still has an IP, but does that mean it's unable to get an IP from the main router (which acts at the DHCP server)?
What seems more likely to be the root issue though is that it appears there is some time sync issue:
Sun Feb 16 04:59:29 2025 user.notice firewall: Reloading firewall due to ifup of lan (br-lan.1001)
Thu Feb 20 08:08:03 2025 cron.err crond[1506]: time disparity of 5948 minutes detected
(the first line can be ignored, it's just to show that there are no other logs the 4 days before that and also, interestingly, the difference between the two timestamps is 5949 minutes.)
but the time appears to be now correct on openwrt:
root@erx:~# date
Thu Feb 20 08:22:14 CET 2025
I found multiple issues related to the clock sync of the mt7621 chipset, but so far I can't find one that really matches my issue well enough.
I could upgrade to 24.10 and see if it helps, but that's really a shot in the dark then.
[edit] couple more commands that might help understanding what is happening.
root@erx:~# hwclock -r
hwclock: can't open '/dev/misc/rtc': No such file or directory
root@erx:~# ps | grep ntp
2078 root 2912 S {ntpd} /sbin/ujail -t 5 -n ntpd -U ntp -G ntp -C /etc/capabilities/ntpd.json -c -u -r /bin/ubus -r /usr/bin/
2093 ntp 1376 S /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2.open
3609 root 1376 R grep ntp
root@erx:~#
root@erx:~# /etc/init.d/sysntpd status
running