Enable LAN port link status in system log when down

Yeah, I followed up in my second comment about the WAN also, sorry for that but it's the same issue in LAN also. I tried to unplug the cable connected from my PC to LAN port of the router but there's no log also.

What device, and what version of OpenWrt?

Could be your log level.

It's TPlink archer c5 v2 using Openwrt version 19.07.10

I just unplugged my WAN cable (on Port 1), and then plugged it back in -

logread -

Thu May 12 00:03:09 2022 kern.info kernel: [168369.008273] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is down
Thu May 12 00:03:17 2022 kern.info kernel: [168377.199989] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up

dmesg -

[168369.008273] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is down
[168377.199989] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up

This worked when I'm using my other Openwrt Newifi, it's just weird that in my TPLink ARcher C5 v2 this doesn't shows up.

Might need to change something here?

root@OpenWrt:~# cat /etc/config/system

config system
        option hostname 'OpenWrt'
        option ttylogin '0'
        option log_size '64'
        option urandom_seed '0'
        option zonename 'Asia/Manila'
        option cronloglevel '5'
        option log_proto 'udp'
        option conloglevel '8'
        option timezone 'PST-8'

Mine is currently set to '6'.

Compare the C5 configs to your other OpenWrt device.

Okay I tried all the numbers from 1-8 but sadly logs about "interface down" doesn't appear. I guess this is an issue for this version of this router? Downgrading might really solve the issue but I'm hoping there's still a possible way to fix this with this latest supported version of this device.

Or maybe this version just doesn't really support the "interface down" logging because if it did, it should be working at the first install and without any tweak.

you can probably work around it, for instance running a ping script, that will alert you (I assume that's the use case here) about any WAN down time.

As suggested above, did you compare the C5 configs with your other OpenWrt device that logs it correctly?

Owh, might be helpful, running a loop ping for the wan and just log when there's a downtime, could you guide me for this if it's possible?

Sorry, I can't compare right now since the other openwrt device is in my province, so what I have right now is the archer c5 v2.

I think it's your device...

The C5 v2 uses the Broadcom chipset, which has very limited support on OpenWrt.

@frollic has the best solution for you.

Yep it's a broadcom so this likely also the reason why it cannot satisfy all the feature of the openwrt and I'm aware that WIFI wont work too. I used the openwrt for this device because of the SQM and dns-over-https.

indeed but the problem is I don't know where to start. Sorry. I'll try to do more research.

check out [How To] Switch on a led when internet connection is available

you will need to modify the LED paths, or if you only need it logged, instead of using the LEDs.

relevant comment about using ping - Disable Wifi when no Internet connection - #9 by vgaetera, with alternative solution.

First of all, thank you very much for the links sir, I finally managed to create a script to log the port status of LAN and WAN though it takes a part of the CPU process maybe because of the while loop that's why I'm only using it in the WAN port. I'm not really good at coding so I don't know if it's an efficient code but anyway, I managed to achieve what I needed. Thank you very much and also to OldNavyGuy. Cheers.

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