Dave Hall Consulting logo

Flakey BIOS in Gigabyte GA-M68SM-S2L Makes MAC Address Change on Reboot

Over the weekend I have been setting my new Mythbuntu pair, a split. back end and front end. Everything has gone pretty smoothly.

One issue I did hit was the onboard NIC on my Gigabyte GA-M68SM-S2L motherboard despite what the specs say it is a "nVidia Corporation Unknown device 054c (rev a2)" which uses the forcedeth driver. Everytime I rebooted the box the NIC would increment its interface number - eth0, eth1 ... eth6 and so on. Changing the "Smart LAN" setting in the BIOS from auto to disabled just disables the NIC, not what I wanted.

After googling I discovered that others had experienced similar problems with ASUS boards with nVidia NICs, changing their MAC addresses. Looks like Gigabyte (and ASUS) have been shipping invalid MAC addresses on some of their boards, and forcedeth isn't happy about it, so it just generates a new (valid yet) random MAC address.

With a little help from sysfs I was able to hack my udev config so it all works now. My /etc/udev/rules.d/70-persistent-net.rules looks like

SUBSYSTEM=="net", DRIVERS=="forcedeth", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x054c", NAME="eth0"

I grabbed the output of "cat /sys/class/net/ethX/device/{device,vendor}" to populate the relevant ATTRS entries above.

I am not sure what you do if you have 2 onboard NICs and they are both broken.

Gigabyte (and ASUS) or nVidia should look at fixing their broken kit to save people from wasting time on this.

Update: It turns out it was a dodgy driver shipped by Ubuntu

two ports?

Russell Coker wrote:

Surely if you disabled the MAC renaming functionality entirely then you would get the default kernel functionality which seems to preserve the numbering for as long as hardware doesn't change.

Before this udev network device renaming was invented we didn't have problems with interfaces changing name.

Added Mon, 2008-02-11 22:43

RE: two ports

Dave wrote:

The problem is that the forcedeth driver detects that the MAC address is invalid and generates a new (and random) hardware address each boot.

A hack would be to disable the MAC address validation in the forcedeth driver, but other parts of the kernel or user space which deal with MAC addresses could choke on the invalid data.

There is a bug filed against udev in ubuntu. I suspect the real fix is to buy a new motherboard.

Added Mon, 2008-02-11 23:15


Joe wrote:

Thanks for posting a fix for this issue. I will try it out tonight on my brother in law's Mythbuntu install. He was having the same issue with his Gigabyte board and was forced to use a 3COM PCI nic to get around this.

Added Wed, 2008-02-20 23:52

It Works

insane_Machine wrote:

It works on my DFI NF4 ultra. Thanks for the tip, I also had this problem under SuSE, but the guide I found for that(http://www.linuxquestions.org/questions/susenovell-60/nvidia-kernel-forc... ) didn't match up for Kubuntu. It was kinda annoying, it got up to eth342 before I found a fix.

Added Mon, 2008-02-25 10:54

Mythbuntu the culprit

pt wrote:

strange I am also running a mythbuntu 7.10 and the same mobo. I had these problems too. But when I checked tested an installation of Hardy Alpha 5, the MAC address stayed constant after reboots, and my router was giving me the same IP address because of the constant MAC address.

I hoping this not because of Mythbuntu but the kernel that comes with Gutsy.

Added Sat, 2008-03-01 06:38

The problem isnt Gigabyte ...

moe wrote:

had the same problems with my new GA-M56S-S3 board. But only when running Linux/Ubuntu, my windoze XP installation had no problems reading out the correct mac-address each time.

So there is no problem with a "broken mac address" on Gigabyte boards, its rather a problem with forcedeth reading out the mac-address in reverse > and this reverse mac-address (stays the same all the time) is then reported to be invalid and a random mac is assigned.

Added Wed, 2008-03-05 23:23

don't blame hw manufacturers!

kaaposc wrote:

NICs are not broken, it is forcedeth driver that misunderstoods MAC addresses. it reads them in wrong byte order and if lowest bit of first byte is 1, it treats MAC address as ethernet multicast address (as stated in IANA papers). that is why it complains about "wrong address" and sets random MAC.

possible fixes: - mangle with udev rules in fashion You did it - make some corrections in drivers/net/forcedeth.c and recompile kernel - get another NIC

Added Fri, 2008-03-14 00:17

Another solution

Thempleton wrote:

This problem may appear with every MB with integrated NIC and user defineable MAC address through the BIOS.

I agree with you, kaaposc, but

>possible fixes: >- mangle with udev rules in fashion You did it

this will stop the increasing /dev/ethx problem, therefore the MAC address will still change at every reboot! giving problems to those using e.g. Shorewall and external routers/firewalls.

Ok, Linux doesn't require reboot as another o.s. we know, for which the external reset button has been invented. ;-) So we shouldn't be bored.

>- make some corrections in drivers/net/forcedeth.c and recompile kernel

this is THE solution.

>- get another NIC

...and have the same problem again.

I'll add this solution which works well for non-kernel-recompile-guys:

- calculate a MAC address so that reading it in reverse byte order the lowest significant bit is "0" (e.g. start it with "0" as the leftmost byte), and write this MAC address to the NIC (through the BIOS or a utility).


Added Mon, 2008-04-07 08:59

Update: Dodgy Driver

Dave wrote:

It turns out that it was a dodgy driver in Gutsy. I have upgraded the box to Ubuntu Hardy Heron and it works fine.

Sorry ASUS, Ubuntu should be coping the blame for this.

Added Fri, 2008-05-16 08:08

Updating post... ?

Mario wrote:

Hi Dave,

this is very interesting blog post, and commentary are really useful - but, now when it's clear where was the catch, maybe you should consider updating original post above, it took some time (and maybe some folks even don't reach it) to read all commentary and your final conclusion.


P.S. I ended here while digging for "Gigabyte M68SM-S2L linux", and this page is first result @ Google! :)

Added Sat, 2008-05-24 09:58

RE: Updating post... ?

Dave wrote:

Good idea, Mario. Done

Added Sun, 2008-05-25 13:20

MAC Address Change on Reboot

Jonny wrote:

It's simple , it's easy, it's work , Thanks sir

thats clear a trouble in my nvidia lan chipset

Added Sat, 2008-07-05 08:35


George Hazlewood wrote:

I've just been bitten by this bug, your blog post is much appreciated. Solve the problem perfectly.

System has an offending nVidia mobo with a NIC affected by the bug.

Set a static IP in /etc/network/interfaces including setting the hwaddress and then set the /etc/udev/rules.d/7-persistent-net.rules as above.

Added Thu, 2008-10-09 23:38