Router reboots when WAN interface goes down

Hello all,

I noticed an interesting behaviour on my router: when the WAN connection goes down for some external reason, after a while the router automatically reboots. Everything comes up and works correctly after that, but I don't know if this behaviour is a bug or a feature.

Does anyone else have similar experience?

The WAN interface gets only a public, dynamic IPv4 address from my ISP using DHCP, via a cable modem in bridge mode. The router is running OpenWRT version 23.05.2, kernel 5.15.137 (I didn't yet have time to upgrade), and the hardware is a PC Engines APU2c4. I have kmod-sp5100-tco installed and can see that procd detects the presence of the watchdog correctly and keeps /dev/watchdog open. But I don't know if the reboot is triggered by the watchdog or something else. IMO this is not a condition on which the watchdog should fire.

I have another APU2c4 wired directly to one of the router's NICs, it's running FreeBSD 14p6 and amongst several internal services for my home network it also collects syslog from the router. Unfortunately there are no clues at all in the logs, here's a snippet about the reboot yesterday morning:

Apr 24 10:38:31 ROUTER collectd[32493]: ping plugin: host EXTERNAL-VPS has not answered 12 PING requests, triggering resolve
Apr 24 10:39:04 FREEBSD kernel: [2197195] igb0: link state changed to DOWN
Apr 24 10:39:10 FREEBSD kernel: [2197201] igb0: link state changed to UP
Apr 24 10:39:52 FREEBSD kernel: [2197243] igb0: link state changed to DOWN
Apr 24 10:40:08 FREEBSD kernel: [2197259] igb0: link state changed to UP
Apr 24 10:40:08 ROUTER ucitrack: Setting up /etc/config/luci-splash reload dependency on /etc/config/firewall
Apr 24 10:40:08 ROUTER ucitrack: Setting up /etc/config/qos reload dependency on /etc/config/firewall

As you can see, the last message is collectd complaining about ping tests failing. Then the igb0 interface of the FreeBSD host flaps when the router reboots. And that's all.

Any ideas?

Well it certainly can trigger the reboot:

Hardware watchdog driver for the AMD/ATI SP5100 chipset. The TCO
(Total Cost of Ownership) timer is a watchdog timer that will reboot
the machine after its expiration. The expiration time can be
configured with the "heartbeat" parameter.

But as to the why you would hope/expect the log would show more

Looks like an obvious culprit. Try to remove the module and simulate a WAN-DOWN scenario to verify.

Thx for the idea guys, will do a test. But for me it's still not reasonable that a WAN flapping would trigger such harsh consequences. I'll see anyways.