Interface 'wan' is always up

Hello OpenWrt community,

I have two routers of different brand but with exactly the same packages installed in both but one seems to have a small problem.
When I unplug the Ethernet cable I don't get the traditional message
daemon.notice netifd: Interface 'wan' is down in the logs but instead I only get the message kernel: [ 817.973791] rt3050-esw 10110000.esw: link changed 0x00.
And this blocks me to run scripts in hotplug...

However the second router has the correct behavior when I plug and unplug the Ethernet cable.
Do any of you have an idea?


if you mention which ones they are, and which one doesn't work the way you expect, you may get a more meaningful answer, rather than speculative (although, the speculation is probably accurate)

1 Like

Hey @vgaetera, @jaromanda,

Thanks for your answers guys.

I think you think too much, I only need to run a script when the Ethernet cable is manually disconnected/connected. But as nothing happens in the logs with one of the routers but only a kernel message which blocks me from running scripts from hotpug...

Anyway, I could solve my problem with the following script by executing the script in background during the boot process which tracks all events in the kmsg file.

#!/usr/bin/awk -f

/rt3050-esw [^ ]* link changed 0x00/ { \
    system( "ubus call network.interface.wan down") }
/rt3050-esw [^ ]* link changed 0x01/ { \
    system( "ubus call network.interface.wan up" ) }

I found the solution in the following thread:

But thanks again!

makes up for people that don't think at all :rofl:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.