• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 11014
  • Last Modified:

Device eth0 has different MAC address than expected, ignoring.

I recently updated my kernel and when i rebooted the server was only accessible through eth2 access on a back ip we have. I looked at ifcfg-eth0 and ifcfg-eth1 and saw that the entry for the MAC address had changed:

HWADDR=00:xx.xx.xx.xx.xx

In /var/log/messages here is whats there:

servername sysctl: net.ipv4.conf.default.accept_source_route = 0
servername kernel: Intel machine check architecture supported.
servername sysctl: kernel.sysrq = 0
servername kernel: Intel machine check reporting enabled on CPU#1.
servername xinetd: xinetd startup succeeded
servername sysctl: kernel.core_uses_pid = 1
servername kernel: CPU1: Intel P4/Xeon Extended MCE MSRs (24) available
servername kernel: CPU1: Thermal monitoring enabled
servername network: Setting network parameters:  succeeded
servername kernel: CPU1: Intel(R) Xeon(TM) CPU 4.00GHz stepping 0a
servername network: Bringing up loopback interface:  succeeded
servername kernel: Booting processor 2/6 eip 3000
servername ntpdate[2222]: sendto(10.xxx.x.xxx): Network is unreachable
servername ifup: Device eth0 has different MAC address than expected, ignoring.
servername kernel: CPU 2 irqstacks, hard=c0405000 soft=c03e5000
servername ntpdate[2222]: sendto(10.xxx.x.xxx): Network is unreachable
servername network: Bringing up interface eth0:  failed
servername kernel: Initializing CPU#2
servername ifup: Device eth1 has different MAC address than expected, ignoring.
servername ntpdate[2222]: sendto(10.xxx.x.xxx): Network is unreachable
servername kernel: Calibrating delay using timer specific routine.. 5999.54 BogoMIPS (lpj=20098)
servername network: Bringing up interface eth1:  failed
servername network: Bringing up interface eth2:  succeeded

So i tried to find the MAC address for eth0 and eth1 but couldnt, so im wondering:

1. How to find your MAC address for eth0 and eth1 when this happens.
2. What caused this to happen in the first place.
0
linuxpig
Asked:
linuxpig
  • 6
  • 4
  • 4
  • +1
1 Solution
 
MatthiasVanceCommented:
I hope this can help you solving problem #1.
http://www.coffer.com/mac_info/locate-unix.html

Kind regards,

Matthias Vance
0
 
linuxpigAuthor Commented:
No it doesnt. Understand that basic commands like ifconfig didnt work because it only showed what was already there, just a MAC for eth2. I needed to find the original MAC for eth0 and eth1, which isnt easy. Also, why did the kernel change the MAC address for eth0 and eth1, see the notes from /var/log.
Im looking for someone who went through something like this when they did a kernel update, not just basic commands.
 
 
0
 
Hugh FraserConsultantCommented:
Check in the file:

/etc/sysconfig/network-scripts/ifcfg-eth(n)

and update the MAC address (you may be able to just delete it).

I don't have a machine handy in the same situation, but with the entry missing on my systems, I can then bring up the interface and find the MAC address to re-enter it.

There are a couple of useful tools for mucking with low-level interface details, like setting full/half, enabling or disabling negotiation, etc..

mii-tool
ethtool

Be careful with them, though. They can really mess things up.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
linuxpigAuthor Commented:
mii-tool just shows if everything is ok, ethtool doesnt show what the original MAC should be. Please re-read my original post, i think the answers are drifting off topic.
 
0
 
Hugh FraserConsultantCommented:
I forgot to answer the question of how this happens. I have a couple of systems with 3 nics. When Linux boots, the pci cards identify themselves, but I've found in the past that the order isn't necessarily consistent. if Linux assigned the first card to eth0, second to eth1, etc. you might (and I have) find that eth0 and eth1 get switched.

So Linux uses the /etc/sysconfig/network-scripts/ifcfg-eth(n) file to tie a MAC address to a nic. If you leave the MAc address line out, it will still work, but the eth(n) mapping can get switched. On a single nic machine, it obviously makes no difference.

I don't have a solution if you use multiple NICs except to say it happens rarely. Having a tool that checks the log file after boot for the problem helps.

I have, though, addressed the problem by switching to a multi-port NIC to replace multiple nics.
0
 
Hugh FraserConsultantCommented:
I didn't mean to drift. Delete the line in

/etc/sysconfig/network-scripts/ifcfg-eth(n)

It's that line that's causing Linux to not start the card, since the two nics are being found in a different order. Restart the nics (ifconfig UP ethn) and you will be able to see the MAC. Re-enter it in the ifcfg file to restore the order checking done at boot.
0
 
joolsCommented:
2. Your kernel upgrade may have updated the modules.conf file and modified the order of the aliases for you nic cards.

for example.
eth0 e1000
eth1 3c59x
becomes
eth0 3c59x
eth1 e1000

This is just a guess, I don't know your system setup and all that.

1 has already been answered, you can just remove HWADDR or use the updated information from ifconfig ethx, if you remove the HWADDR you may have problems if it happens again because your different IP's will be assigned to the wrong interface, this may not be a good idea if you have configured firewall rules based on interface number!

0
 
linuxpigAuthor Commented:
What i had to do to get the server up was edit modprobe.conf to use the tg3 drivers. In the modprobe.conf file i commented out the broadcom drivers. Here is my modprobe.conf file below

#alias eth0 bcm5700
alias eth0 tg3
#alias eth1 bcm5700
alias eth1 tg3
alias eth2 e1000
alias eth3 e1000
alias scsi_hostadapter cciss
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd


Here is one from a working server that the kernel update worked on:
alias eth0 bnx2
alias eth1 bnx2
alias eth2 bnx2
alias scsi_hostadapter cciss
alias usb-controller uhci-hcd
alias usb-controller1 ehci-hcd
alias scsi_hostadapter1 ata_piix
0
 
joolsCommented:
On the working server they are all bmx2 drivers, it is a possibility that the modules were renamed when you kernel was updated but it's difficult to tell without knowing what was there before.

Is there a renamed modules file on your system, the old one may have been renamed.
0
 
linuxpigAuthor Commented:
Im wondering if the kernel installed new ones and erased old ones
0
 
joolsCommented:
possibly...
0
 
linuxpigAuthor Commented:
How can this be prevented from happening again?
0
 
Hugh FraserConsultantCommented:
Prevented... not that I know of. Detected? Of course. As I mentioned, this is an infrequent problem that's handled by the ifcfg-ethn file by tying a specific eth to a MAC address. When, for whatever reason, the OS shuffles the mapping of nic to eth device, it's detected when the network starts up and is alarmed.

Look at adding a rule to a tool like ossec, or script something to look for the alarm, or check the interfaces. Then page yourself if there's a problem.
0
 
linuxpigAuthor Commented:
Now that i have selected new drivers in modprobe.conf and the server is up. Can i expect the server to become unresponsive again if i reboot the server or update other packages?
0
 
joolsCommented:
There is no reason for it not to work on next reboot, as long as service network restart runs thru clean then you should be OK.

As far as updates are concerned it's difficult to say, if you hard code the HWADDR at least you will know you have an issue and you now know what may be (at least one of) the causes and can rectify it.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now