brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ethtool -p blinks the LED of a network port so you can find it in the rack

Linux
~/tips/tip-linux-ethtool-p-blink-port

ethtool -p eth1 10

Make the port light blink so you know which physical socket belongs to eth1.

A server with four network ports and names like enp3s0f1 does not tell you which socket on the back is which. The card can show you.

ethtool -p eth1 10

The man page calls this an identify action: it usually blinks one or more LEDs on that port, here for ten seconds. Walk to the machine, look for the blinking light, and label the cable while you are there. I find that a lot quicker than pulling cables and watching which interface goes down.

Leave out the number and it keeps blinking until you press Ctrl-C:

ethtool -p eth1

That is handy when the machine is in another room and you need a moment to walk over.

Whether it works depends on the card and its driver. Most server and Intel cards support it, while some cheap onboard chips and USB adapters answer with Operation not supported or do nothing visible. Virtual interfaces like bridges have no LED, so point it at the real port and not at br0. Blinking does not interrupt traffic, so it is safe on a port that is in use, but it does need root.

Further reading: ethtool(8) manual page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link