[OpenWrt-Devel] Link detection - TP-Link Archer C7 v2

Richard Clark richard at kerkhofftech.ca
Wed May 27 11:44:09 EDT 2015

On 05/27/2015 03:59 AM, Christian Mehlis wrote:
> Hi Richard,
> I had this problem a moth ago with this board:
> I found no solution so far...
> Christian

For now I have added a little script in the background that just watches
for the link status using swconfig

swconfig dev ag71xx-mdio.0 port 1 get link | grep -q up
swconfig dev ag71xx-mdio.0 port 1 get link | grep -q down

Test the return for success/fail, then issue ifconfig eth0 up/down as
appropriate, and netifd goes about doing what it should have done with
the cable was yanked.

Just an endless loop testing for link up first, since an extra ifconfig
up on an already up IF will do nothing anyway, and I can't assume that
it is going to be 'up' when the script first runs in the init process

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list