I think, most simple would be to detect a link up/down with Hotplug and then run ifup/down on ethernet so route is automatically removed.
I tried to add my hotplug script: root@:/# cat /etc/hotplug.d/iface/40-eth # enable access from client network #[ "$INTERFACE" = lan ] || exit 0 #[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0 #echo 'EISOX: Ethernet up' > /dev/kmsg [ ifup = "$ACTION" ] && { echo 'ACTION $ACTION ' > /dev/kmsg } but nothing is written in dmesg. Is hotplug.d enabled? I'm a bit lost between hotplug, netifd, procd, I've read the OpenWRT documentation but I'm still confused what the difference and how to use them Cheers, 2016-07-12 18:25 GMT+02:00 David Lang <da...@lang.hm>: > If the network interface goes through the switch in the AP, then you will > not see the interface on the CPU go up/down. At best you could poll the > switch info (if it gives you link state) > > David Lang > > > On Tue, 12 Jul 2016, Baptiste Clenet wrote: > >> Ok thanks Tobias. >> How can I detect that ethernet is plugged with hotplug? I tried some >> script but it never raises. >> Thing is I will know when wifi is up, ok but I have to know if eth is >> plugged or not since there is no eth down when eth is unplugged. >> >> 2016-07-07 0:30 GMT+02:00 Tobias Welz <t...@wiznet.eu>: >>> >>> Hum, now you want to toggle wifi - this is a totally different request. >>> This >>> can maybe done by hotplug events on the ethernet executing "wifi up" and >>> "wifi down" >>> You could also have a look if there is some package that might support >>> something like that - i don't know if e.g. mwan3 package can do that. -- Baptiste _______________________________________________ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev