FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 10-15-2010, 08:17 PM
Yong Huang
 
Default Find MAC address stored in NIC firmware

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




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 10-15-2010, 09:01 PM
 
Default Find MAC address stored in NIC firmware

redhat-list-bounces@redhat.com wrote on 10/15/2010 03:17:41 PM:

> From: Yong Huang <yong321@yahoo.com>
> To: redhat-list@redhat.com
> Date: 10/15/2010 03:50 PM
> Subject: Find MAC address stored in NIC firmware
> Sent by: redhat-list-bounces@redhat.com
>
> 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@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 10-16-2010, 01:31 PM
Yong Huang
 
Default Find MAC address stored in NIC firmware

> 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

Thank you. Do you mind testing changing the MAC with ifconfig to see
if your lspci still shows the original?

Unfortunately, my HP box running RHEL5 doesn't have it with lspci -vv
or -vvv.

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
# uname -a
Linux myhostname 2.6.18-194.17.1.el5 #1 SMP Mon Sep 20 07:12:06 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

# dmidecode | more
# dmidecode 2.10
SMBIOS 2.3 present.
77 structures occupying 2033 bytes.
Table at 0x000EC000.

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
Vendor: HP
Version: P51
Release Date: 04/26/2006
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 4096 kB
...
System Information
Manufacturer: HP
Product Name: ProLiant DL380 G4
Version: Not Specified
Serial Number: USE525A8HB
UUID: 33373338-3232-5553-4535-323541384842
Wake-up Type: Power Switch
...

# lspci -vv | more
...
03:01.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet (rev 10)
Subsystem: Compaq Computer Corporation NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64 (16000ns min), Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 217
Region 0: Memory at fddf0000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [40] PCI-X non-bridge device
Command: DPERE- ERO- RBC=2048 OST=1
Status: Dev=03:01.0 64bit+ 133MHz+ SCD- USC- DC=simple DMMRBC=2048 DMOST=1 DMCRS=16 RSCEM- 266MHz- 533MHz-
Capabilities: [48] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable+ DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data
Capabilities: [58] Message Signalled Interrupts: 64bit+ Queue=0/3 Enable-
Address: dd5755f73ffbeddc Data: 15ec


I played with lots of combinations of the options of lspci command. No
luck.

Yong Huang





--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 10-21-2010, 01:35 PM
"urgrue"
 
Default Find MAC address stored in NIC firmware

dmidecode will show you the real hardware MAC address.
If you're using bonding you can also see it in /proc/net/bonding/bondX,
this lists both the permanent address and the active one.



On Sat, 16 Oct 2010 06:31 -0700, "Yong Huang" <yong321@yahoo.com> wrote:
> > 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
>
> Thank you. Do you mind testing changing the MAC with ifconfig to see
> if your lspci still shows the original?
>
> Unfortunately, my HP box running RHEL5 doesn't have it with lspci -vv
> or -vvv.
>
> # cat /etc/redhat-release
> Red Hat Enterprise Linux Server release 5.5 (Tikanga)
> # uname -a
> Linux myhostname 2.6.18-194.17.1.el5 #1 SMP Mon Sep 20 07:12:06 EDT 2010
> x86_64 x86_64 x86_64 GNU/Linux
>
> # dmidecode | more
> # dmidecode 2.10
> SMBIOS 2.3 present.
> 77 structures occupying 2033 bytes.
> Table at 0x000EC000.
>
> Handle 0x0000, DMI type 0, 20 bytes
> BIOS Information
> Vendor: HP
> Version: P51
> Release Date: 04/26/2006
> Address: 0xF0000
> Runtime Size: 64 kB
> ROM Size: 4096 kB
> ...
> System Information
> Manufacturer: HP
> Product Name: ProLiant DL380 G4
> Version: Not Specified
> Serial Number: USE525A8HB
> UUID: 33373338-3232-5553-4535-323541384842
> Wake-up Type: Power Switch
> ...
>
> # lspci -vv | more
> ...
> 03:01.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5704
> Gigabit Ethernet (rev 10)
> Subsystem: Compaq Computer Corporation NC7782 Gigabit Server
> Adapter (PCI-X, 10,100,1000-T)
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr+ Stepping- SERR+ FastB2B-
> Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
> Latency: 64 (16000ns min), Cache Line Size: 64 bytes
> Interrupt: pin A routed to IRQ 217
> Region 0: Memory at fddf0000 (64-bit, non-prefetchable)
> [size=64K]
> Capabilities: [40] PCI-X non-bridge device
> Command: DPERE- ERO- RBC=2048 OST=1
> Status: Dev=03:01.0 64bit+ 133MHz+ SCD- USC- DC=simple
> DMMRBC=2048 DMOST=1 DMCRS=16 RSCEM- 266MHz- 533MHz-
> Capabilities: [48] Power Management version 2
> Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot+,D3cold+)
> Status: D0 PME-Enable+ DSel=0 DScale=1 PME-
> Capabilities: [50] Vital Product Data
> Capabilities: [58] Message Signalled Interrupts: 64bit+ Queue=0/3
> Enable-
> Address: dd5755f73ffbeddc Data: 15ec
>
>
> I played with lots of combinations of the options of lspci command. No
> luck.
>
> Yong Huang
>
>
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 10-21-2010, 07:14 PM
Yong Huang
 
Default Find MAC address stored in NIC firmware

> dmidecode will show you the real hardware MAC address.
> If you're using bonding you can also see it in /proc/net/bonding/bondX,
> this lists both the permanent address and the active one.

urgrue,

You're right about /proc/net/bonding/bondX. I just checked. It has
"Permanent HW addr", which is NOT changed by `ifconfig .. hw ether ...'.
This at least serves as a workaround for those interfaces I have bonding
on. Thank you!

I can't get dmidecode to show the real MAC address. BTW, I got in touch
with an author of ethtool. He provided a patch to expose perm_addr as a
command line option for ethtool. I haven't run patch for too many years
so for now I'm just waiting for the patched source to be available.

Yong Huang




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 02:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org