When working in data centers or server racks, identifying a specific network interface card (NIC) among dozens can be challenging. The ethtool
utility provides the perfect solution with its LED blinking functionality.
sudo ethtool -p|--identify [interface_name] [duration_in_seconds]
Example to blink eth0 for 30 seconds:
sudo ethtool -p eth0 30
This becomes particularly useful when:
- Rack-mounting new servers
- Troubleshooting network connectivity
- Verifying interface mapping in virtualization
- Confirming link status during maintenance
For persistent identification (until manually stopped):
sudo ethtool --identify eth0 0
To stop the blinking:
sudo ethtool --identify eth0 off
While ethtool
is Linux-specific, other platforms have similar tools:
- Windows: Device Manager's "Blink LED" option
- Cisco IOS:
test interface
command - HP ProCurve:
show port led
If the blinking doesn't work:
- Verify interface is up (
ip link show
) - Check driver support (
ethtool -i eth0
) - Confirm NIC actually has controllable LEDs
When working in server rooms with multiple network interfaces, identifying a specific NIC can be challenging. The ethtool
utility provides a simple way to flash the link light on Ethernet adapters for physical identification.
sudo ethtool -p [interface_name] [duration_in_seconds]
Example to blink eth0 for 30 seconds:
sudo ethtool -p eth0 30
For scripting purposes, you might want to combine this with interface discovery:
#!/bin/bash
INTERFACE="eth0"
DURATION=60
if ip link show $INTERFACE > /dev/null 2>&1; then
sudo ethtool -p $INTERFACE $DURATION
echo "Blinking $INTERFACE for $DURATION seconds"
else
echo "Interface $INTERFACE not found"
fi
Some distributions may use different tools:
mii-tool
on older systemsip link set dev [interface] flash
on some modern kernels
If the command doesn't work:
- Verify NIC driver supports this feature:
ethtool --show-features [interface]
- Check for firmware updates
- Try root privileges if not already using sudo
For persistent identification, consider labeling or using unique MAC addresses:
ethtool -P eth0