Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have CentOS 5.5
I want to list all availible physical (or virtual on DomU) NICs connected to motherboard and see it's MAC addresses.
I guess that related information should be somewhere in /proc or may be in output of some command.
The option to list ifcfg-ethX files clearly not suitable here.

Thank you for ahead.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

/sys/class/net/*/address

share|improve this answer
    
Thank you very much. And here is oneliner for match interface with MAC address. You are welcome to make it shorter: ls -d /sys/class/net/* | while read line; do echo -en "echo $line | cut -d'/' -f 5\t:"; echo -e "\t`cat $line/address`"; done –  Rodnower Aug 23 '10 at 10:47
    
for i in /sys/class/net/* ; do echo -en "${i##*/}:\t" ; cat "$i"/address ; done –  Ignacio Vazquez-Abrams Aug 23 '10 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.