[TOS 6.4.4] How to delay retry on interface restarts?

My WAN interface is via PPPOE to a Gbit fiber network. This weekend a hedge cutter shredded the line up the street so the fiber has been dead for a couple days. I see in the /var/log/messages that netifd sees that the interface is dead and keeps retrying to connect it. When pppd exits with a failure, it sleeps for 10 seconds, then netifd does an ifdown followed by an immediate ifup on the corresponding eth interface. It seems like this rapid down/up on the eth port eventually kills something on my br-lan because after a few hours of these retries, devices on my wifi network can no longer talk to devices on my wired LAN.

Right now I’ve manually done an “ifdown wan” to stop the endless retries, but I’d like some kind of retry so that eventually it can automatically bring itself back up. I just think I need a way to tell netifd to pause between issuing the ifdown and the ifup. Does anyone know of a way to configure it to do that?

Here’s what I’m seeing. Notice at 13:44:05 the wan interface is disabled and then immediately enabled again. And the same thing happens again multiple times:

Dec  4 13:44:05 turris pppd[21352]: Timeout waiting for PADO packets
Dec  4 13:44:05 turris pppd[21352]: Unable to complete PPPoE Discovery
Dec  4 13:44:05 turris pppd[21352]: Exit.
Dec  4 13:44:05 turris netifd: Interface 'wan' is now down
Dec  4 13:44:05 turris ModemManager[21410]: hotplug: remove network interface eth2.10: event processed
Dec  4 13:44:05 turris ModemManager[21410]: hotplug: event reported: action=remove, name=eth2.10, subsystem=net
Dec  4 13:44:05 turris kernel: [  500.350877] mvneta f1034000.ethernet eth2: Link is Down
Dec  4 13:44:05 turris netifd: Interface 'wan' is disabled
Dec  4 13:44:05 turris kernel: [  500.448203] mvneta f1034000.ethernet eth2: PHY [f1072004.mdio-mii:01] driver [Marvell 88E1510] (irq=POLL)
Dec  4 13:44:05 turris kernel: [  500.467125] mvneta f1034000.ethernet eth2: configuring for phy/sgmii link mode
Dec  4 13:44:05 turris netifd: Interface 'wan' is enabled
Dec  4 13:44:05 turris netifd: Interface 'wan' is setting up now
Dec  4 13:44:05 turris netifd: VLAN 'eth2.10' link is down
Dec  4 13:44:05 turris netifd: Interface 'wan' has link connectivity loss
Dec  4 13:44:05 turris netifd: Network device 'eth2' link is down
Dec  4 13:44:05 turris insmod: module is already loaded - slhc
Dec  4 13:44:05 turris insmod: module is already loaded - ppp_generic
Dec  4 13:44:05 turris insmod: module is already loaded - pppox
Dec  4 13:44:05 turris insmod: module is already loaded - pppoe
Dec  4 13:44:05 turris netifd: wan (21481): ppp: warning: Sleeping for '60' seconds
Dec  4 13:44:06 turris ModemManager[21476]: hotplug: add network interface eth2.10: event processed
Dec  4 13:44:06 turris ModemManager[21476]: hotplug: event reported: action=add, name=eth2.10, subsystem=net
Dec  4 13:44:06 turris ModemManager[21476]: hotplug: parent device sysfspath not found
Dec  4 13:44:06 turris odhcpd[5146]: Failed to send to ff02::1%guest_turris@br-guest-turris (Address not available)
Dec  4 13:44:06 turris netifd: Interface 'wan' is now down
Dec  4 13:44:06 turris netifd: Interface 'wan' is disabled
Dec  4 13:44:06 turris ModemManager[21689]: hotplug: remove network interface eth2.10: event processed
Dec  4 13:44:07 turris ModemManager[21689]: hotplug: event reported: action=remove, name=eth2.10, subsystem=net
Dec  4 13:44:07 turris kernel: [  501.637932] mvneta f1034000.ethernet eth2: PHY [f1072004.mdio-mii:01] driver [Marvell 88E1510] (irq=POLL)
Dec  4 13:44:07 turris kernel: [  501.647748] mvneta f1034000.ethernet eth2: configuring for phy/sgmii link mode
Dec  4 13:44:07 turris netifd: Interface 'wan' is enabled
Dec  4 13:44:07 turris ModemManager[21707]: hotplug: add network interface eth2.10: event processed
Dec  4 13:44:07 turris ModemManager[21707]: hotplug: event reported: action=add, name=eth2.10, subsystem=net
Dec  4 13:44:07 turris ModemManager[21707]: hotplug: parent device sysfspath not found

I am no expert but I would look at the “delay” or “keepalive” setting. Look at OpenWRT documentation about WAN

I’ve already set the keepalive option. It looks like delay only applies to USB modems.

From the log, it looks like it may have something to do with hotplug, the driver reports that the device exists, and then netifd tries to immediately enable it.