Link Status

I had a co-worker help write this nifty command that I’ve trimmed down.

It’s a quick way to check your ports after starting your switches in your home lab.

I’ve found it particularly useful when used with remote power (ie IP Power).

ifconfig | cut -f1 -d' ' | tail -n +2 | xargs -n1 sudo ethtool $i | egrep '(Se|L)'

This is the output I get from running this command:

Settings for eth1:
Link detected: yes
Settings for eth2:
Link detected: yes
Settings for eth3:
Link detected: yes
Settings for eth4:
Link detected: yes
Settings for eth5:
Link detected: yes
Settings for eth6:
Link detected: yes
Settings for eth7:
Link detected: yes
Settings for eth8:
Link detected: yes
Settings for eth9:
Link detected: yes
Settings for eth10:
Link detected: yes
Settings for eth11:
Link detected: yes
Settings for eth12:
Link detected: yes
Settings for lo:
Link detected: yes
Settings for vmnet1:
Settings for vmnet8:

Be aware that 3560 links take a while to show as “up” due to Auto-MDIX.

Advertisements

About this entry