redhat-list-bounces@xxxxxxxxxx wrote on 10/15/2010 03:17:41 PM: > From: Yong Huang <yong321@xxxxxxxxx> > To: redhat-list@xxxxxxxxxx > Date: 10/15/2010 03:50 PM > Subject: Find MAC address stored in NIC firmware > Sent by: redhat-list-bounces@xxxxxxxxxx > > The MAC address of an Ethernet network card can be changed with > ifconfig or ip command. Correct me if wrong. But I think the real > hardware address stored in the NIC firmware is not changed. How do I > find the real MAC address? I checked ifconfig, ip, lspci, dmidecode, > /sys/class/net/..., and ethtool. Most report whatever is shown by > ifconfig, which could have been altered. The only possible solution > is to dump EEPROM of NIC. > > For NIC using e1000 driver: > > # ifconfig eth3 | grep HW > eth3 Link encap:Ethernet HWaddr 00:11:0A:56:81:B1 > <-- We changed it to this earlier. > # ethtool -e eth3 | head -3 <-- dump EEPROM > Offset Values > ------ ------ > 0x0000 00 11 0a 56 81 b0 30 05 ff ff ff ff ff ff ff ff > <-- first 6 bytes are HW address 00:11:0a:56:81:b0 > # ifconfig eth3 hw ether 00:11:0a:56:81:ff <-- assign an arbitrary one > # ifconfig eth3 | grep HW > eth3 Link encap:Ethernet HWaddr 00:11:0A:56:81:FF > <-- ifconfig is fooled > # ethtool -e eth3 | head -3 > Offset Values > ------ ------ > 0x0000 00 11 0a 56 81 b0 30 05 ff ff ff ff ff ff ff ff > <-- but firmware ignores it > # ifconfig eth3 hw ether 00:11:0a:56:81:b1 <-- temporarily change it > back to what we had > # ll /sys/class/net/eth3/device/driver/ | grep module > lrwxrwxrwx 1 root root 0 Oct 14 21:29 module -> ../../../../ > module/e1000 <-- driver for it is e1000 > # ethtool -i eth3 <-- another way to check driver > driver: e1000 > version: 7.3.21-k4.1-NAPI > firmware-version: N/A > bus-info: 0000:06:01.1 > > For a NIC using tg3 or bnx2 driver, the command has to be `ethtool - > e eth1 length <some number>', otherwise I would get "Cannot get > EEPROM data: Cannot allocate memory". Then the hw address is in the > data or value column starting at some offset. The command output is > long so has to be saved in a file to be view'ed with vi. > > Question: What's the correct way to find the original manufacturer's > MAC address of an Ethernet card? > > Yong Huang On and HP server running RHEL5 you can search for the Ethernet controllers in this output /sbin/lspci -vv | more [snip] 03:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20) Subsystem: Hewlett-Packard Company NC382i Integrated Quad Port PCI Express Gigabit Server Adapter [snip] Link: Supported Speed 2.5Gb/s, Width x4, ASPM L0s L1, Port 0 Link: Latency L0s <4us, L1 <4us Link: ASPM Disabled RCB 64 bytes CommClk- ExtSynch- Link: Speed 2.5Gb/s, Width x2 **** Capabilities: [100] Device Serial Number 46-1b-8e-fe-ff-d1-e7-78 Capabilities: [110] Advanced Error Reporting Capabilities: [150] Power Budgeting Capabilities: [160] Virtual Channel ## The MAC address will be 78:e7:d1:8e:1b:46 play with this on a good machine. Had to do this when all the disks pulled from one chassis and put into the new chasis. The disks still had the old IP's in the ifcfg-eth# files -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list