The issue occurs only after a power loss of the upstream ISP switch (located on the rooftop).
After power is restored:
the physical WAN link comes up
netifd considers the wan interface up
PPPoE does not establish
there are no automatic retry attempts
lcp-echo does not help, because the PPPoE session is never established in the first place.
After running ifdown wan && ifup wan manually, the Internet connection is restored immediately.
A canonical / proper solution is needed (without cron jobs or ping-based watchdog hacks) so that PPPoE reliably reconnects after an upstream power loss.
Hi! From your post, it seems that the issue isn’t the PPPoE connection itself, but rather that after a blackout of the upstream ISP switch, the PPPoE session doesn’t start automatically, even though the WAN link is up.
To better understand if your configuration can handle this scenario, you should check these points in your /etc/config/network:
If your configuration is exactly like this, then something is missing for the behavior you want. Specifically, to make PPPoE reconnect automatically after a blackout, you should at least add these options:
option auto '1' # forces netifd to attempt the connection even if the link is already up
option keepalive '6 10' # PPPoE will try to reestablish the connection if it fails
option demand '0' # disables on-demand mode
With these additions, the router should reconnect automatically without needing to run ifdown/ifup manually or use cron/ping scripts.
You can check this, and if you want, post your full configuration (masking username/password of course) so we can confirm everything is set up correctly.
ps: I extracted an old configuration of yours, in case it has changed it would be possible to see the current configuration
I don't know all the details, so this explanation may be incomplete.
As far as I know, option norelease '1' is a netifd/DHCP option that tells the system not to send a release message to the server when the interface is brought down. In practice, it prevents the DHCP lease (v4 or v6) from being released immediately.
This option does not affect the establishment of a PPPoE connection or the behavior of reconnection attempts, because PPPoE messages such as PADT are handled separately by pppd.
Since norelease is not necessary in most configurations, it may be worth temporarily removing it to rule out any side effects on DHCP.
PS: To reduce disconnections after power outages or upstream interruptions, it is recommended to connect both the ISP modem and the OpenWrt router to a small UPS. This way, the WAN link remains stable even during short outages, preventing PPPoE from failing to reconnect automatically.
The key point is this: you need to determine whether netifd actually detects the link down event when the ISP switch loses power.
During the outage, try monitoring with: “logread -f”
and see if any "link down" messages appear on the WAN interface.
Case 1 — Link down is detected Then the problem is only in the management of the state transition. In this case, you can intervene correctly at the hotplug level (ifup/ifdown events), without using a watchdog or cron. This is a clean solution and consistent with OpenWrt's design.
Case 2 — Link down is NOT detected Then the driver/PHY is not generating the correct event. In this case, you need to analyze the logs, and if the behavior is reproducible, it may be appropriate to file a bug in OpenWrt. Before modifying PPPoE parameters, it's important to clarify this point: if the system doesn't see the link state change, pppd will never restart automatically.
Unfortunately I don't have any more information to give you any more useful advice.
yes, this is my case. but how to properly solve it using the links you gave? it is very difficult for me understand these documentations.
OMG, on my old TP Link WR940N with stcok firmware I never had this type of the issues during power outage. Here on Openwrt it is a huge problem to make it work…
#!/bin/sh
# Ensure the interface is WAN
[ "$INTERFACE" = "wan" ] || exit 0
# Log the hotplug event
logger "HOTPLUG EVENT: INTERFACE=$INTERFACE ACTION=$ACTION"
# Only when the interface goes UP
if [ "$ACTION" = "ifup" ]; then
# Save full interface status to a temp file (for debugging)
ifstatus wan > /tmp/pppoe-status.log
# Extract whether PPPoE is UP
PPP_UP=$(ifstatus wan | grep -o '"up": true')
# Log the current PPPoE status
if [ "$PPP_UP" = '"up": true' ]; then
logger "PPPoE STATUS: UP"
else
logger "PPPoE STATUS: DOWN"
fi
fi
If the previous one works and you see events being logged you can try this:
file to create: /etc/hotplug.d/iface/99-pppoe-restart
#!/bin/sh
[ "$INTERFACE" = "wan" ] || exit 0
if [ "$ACTION" = "ifup" ]; then
logger "WAN ifup event detected"
if ! ifstatus wan | grep -q '"up": true'; then
logger "PPPoE not up, restarting wan"
ifdown wan
sleep 2
ifup wan
fi
fi
If you want to keep the file during updates, add it to the list of files to save: