if disconnect the cable, then Linux believes that the cable is still there, because of this does not work keepalived (vrrp)
# for i in $( ls /sys/class/net ); do echo -n $i; ethtool $i | grep Link\ d; done
bond0 Link detected: no
bonding_mastersCannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
eth0 Link detected: yes (cable disconnect)
eth1 Link detected: yes
lo Link detected: yes
It is right because eth0 and 1 is connected to mt7530, eth0 and eth1 just represents the CPU ports on switch and they are always kept as 1g link. The result you expect should depend on ports in the front of board, but those port can’t be model as netdev in kernel .
It is just a notification from hardware but is not reported into netdevice (how do you have multiple ports fitting into single netdev?) as you query got from ethtool. You can use latest kernel to reach what you want, the switch uses dsa to represent each port as independent netdevie.
We updated kernel to latest version (4.4.70 from GitHub). ifconfig show us two eth, that always up(problem still here). Must we use some special commands, when compiling the kernel? May be we must install some packages ?