LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   ifconfig and dmesg| grep eth report different mac (https://www.linuxquestions.org/questions/linux-hardware-18/ifconfig-and-dmesg%7C-grep-eth-report-different-mac-700216/)

pgb205 01-27-2009 09:47 AM

ifconfig and dmesg| grep eth report different mac
 
like the headline states I have several different nics on the system and would like to figure out the mac address for each so:
ifconfig eth0 gives me the mac for interface 0.
But when i do dmesg| grep -i eth0 I get a different mac address reported for the interface. So basically I'm getting inconsistent information.
Which output should I trust or do I need to take extra steps to make sure.

thanks

Didier Spaier 01-27-2009 03:52 PM

The mac address identify a physical device, not an interface. Interface names can change: though they be usually allocated by the kernel at start up in the order it discovers the devices, you can change it through udev rules, for exemple to make sure you keep the same interface name for the same device.

Here is an example:
Code:

bash-3.1# dmesg|grep eth0
eth0: RealTek RTL8139 at 0xa000, 00:02:3f:07:a4:a5, IRQ 11
eth0:  Identified 8139 chip type 'RTL-8101'
bash-3.1#

I now that my ethernet card has the mac address 00:02:3f:07:a4:a5. It could be associated later to another interface name that eth0, this doesn't matter.


All times are GMT -5. The time now is 09:45 AM.