You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
402 B

echo "Try"
for i in $(ip -o link show | awk -F': ' '{print $2}'); \
do mac=$(ethtool -P $i) \
&& printf '%-10s %-10s\n' "$i" "$mac"; \
done
echo "OR"
ls -l /sys/class/net/
echo "So, actual devices show in /sys/class/net. Note that aliases (like lan:0) do not (so you can tell which are aliases). "
echo "And you can clearly see which are actual hardware (lan) and which aren't (br0, lo, tun0)."