April 9, 2008
Did you ever have the problem that you didn’t know to which switch port a given ethernet port /cable is connected to? Wouldn’t it be cool if the LED of the switch port would blink so you know which one is the correct one?
You’re lucky – it is possible with Linux. There are even two ways. With some chipsets
ethtool -p eth0 works but not with all. But following script also helps in any case:
# usage example: blink.sh eth0
while true ; do
ifconfig $1 down
ifconfig $1 up
Put that script into
/usr/local/sbin/blink.sh and set the execution permissions. Call it with the device as parameter. Don’t set the blinking below 2sec as it is possible that the connection negation takes up to that amount of time.