the port lan2 of my OpenWrt device (Linksys WRT1900ACS-V2) is cable connected with the lan port of an access point not running OpenWrt; as soon as I reboot the access point, OpenWrt system log says:
Fri Jan 3 19:00:42 2025 daemon.notice netifd: Network device 'lan2' link is down
Fri Jan 3 19:00:42 2025 kern.info kernel: [379772.003753] br-lan: port 2(lan2) entered disabled state
Fri Jan 3 19:00:42 2025 kern.info kernel: [379772.009383] mv88e6085 f1072004.mdio-mii:00 lan2: Link is Down
Fri Jan 3 19:00:47 2025 kern.info kernel: [379776.956196] mv88e6085 f1072004.mdio-mii:00 lan2: Link is Up - 1Gbps/Full - flow control rx/tx
Fri Jan 3 19:00:47 2025 kern.info kernel: [379776.956214] br-lan: port 2(lan2) entered blocking state
Fri Jan 3 19:00:47 2025 kern.info kernel: [379776.970206] br-lan: port 2(lan2) entered forwarding state
Fri Jan 3 19:00:47 2025 daemon.notice netifd: Network device 'lan2' link is up
Based on the above, on the OpenWrt device I created the /etc/hotplug.d/iface/90-my-action script containing:
Unfortunately, when I reboot the access point the /tmp/debug-hotplug.log file is not written, i.e. the script is not executed; I also get the same result if I move the script to /etc/hotplug.d/net/. Already surfed the forum, but not able to find anything useful: any hint?
(By the way, my ultimate goal is to take action as soon as the access point goes down/up).
I already found this suggestion, but the Force link is only available with interface lan, not with device lan2. Moreover, the log shows me that the script is executed only once, when OpenWrt device reboots, and it does not run when lan2 goes down because the access point (e.g.) reboots, which is my goal...
then create an interface using add button. you can select the protocol unmanaged and device as the lan2 (/whichever ethernet is showing as) and in advanced setting disable the force link option, save and restart
Saw what the other person said? Those events are intentionally filtered. So you would have to remove the filter. But it could have unintended side effects.
My goal is to send an email warning as soon as the network (lan2) speed between the OpenWrt device and the access point is less than 1 Gbps, and to perform the same action when the access point goes up/down.
I performed a quick test and your suggestion worked (problem solved), so my next step is writing the hotplug iface script to reach the goal.