July 10, 2006
Swap Happy NICs on FC5
When Red Hat's
netconfig tools (on either RHEL or Fedora) create
/etc/sysconfig/network-scripts/ifcfg-ethX files, they always add in the
HWADDR=00:00:00:00:00:00 line. There have been a couple of times that I have run into trouble because of that line.
ifup finds the
HWADDR variable in an
ifcfg-foo file, it uses the value to verify that it is configuring the correct interface. If it doesn't match, it bails out. Because of this, I have often told students that if they expect to be swapping NICs or if they run into a problem where ifup refuses to configure the interface, to try removing (or commenting out) the
HWADDR line entirely. I have even gotten into the habit of just removing it on my own personal servers, workstations & notebooks.
However, not having
HWADDR in my
/etc/sysconfig/network-scripts/ifcfg-ethX files on my notebook actually caused me a little bit of trouble, today.
Running Fedora Core 5 (FC5), I saw my NICs swap places during bootup. This happened first a few weeks ago, and only happened once, so I figured it was probably a fluke. Then, Clint's new notbook did it several times to him. When it happened to me again this morning, I decided to dig a little deeper.
Looking at the changelog for the latest updated version of the
initscripts package (which
/etc/rc.sysinit is part of), shows:
* Fri Jul 07 2006 Bill Nottingham <HIDDEN EMAIL> 8.31.5-1
- backport cups startup fix (#189168)
* Fri Jun 30 2006 Bill Nottingham <HIDDEN EMAIL> 8.31.4-1
- backport bridge fixes (#187100)
- ignore alias devices in rename_device (#186355)
* Fri Mar 17 2006 Bill Nottingham <HIDDEN EMAIL> 8.31.2-1
- add udev helper to rename network devices on device creation
So, I checked out https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186355. Although the issues that bug's reporter (and others) were having was related to the use of Virtual Interfaces, it touched on things that could help explain the error I was seeing. A little more digging around on Bugzilla didn't produce any useful results right away, however, and as I'm teaching Guru Labs' GL510 Network Security course (which is rather in-depth), I didn't have time to do any more digging right then. So, I sent a quick little email to Bill Nottingham at Red Hat, asking if he's been seeing this problem. This was his response:
Lamont R. Peterson said:
> A couple of weeks ago, my notebook's two interfaces (eth0 3C920, eth1 IPW2915)
> came up swapped (wireless eth0 wired eth1). It only happened the once, until
> today, to me. One of my co-workers saw it several times last week. A couple
> of other people I know have seen this happen once in the last month or so,
> like I did.
> Looking at the changelog for initscripts, I see that /etc/rc.sysinit has seen
> some changes regarding udev and device renaming for NICs.
Yep. Stock answer is to make sure you have HWADDR= correct in all your
ifcfg-XXXX files, and upgrade to the current FC5 update (8.31.5) initscripts.
Basically, udev can load/initialize interfaces in random order, so we
need code to try and get them back in the order they're configured.
So, I've added the
HWADDR lines back in on my notebook. Unfortunately, it'll be hard to test if that fixes such an intermittent issue, but, I think that this is the "right" fix for my notebook.
I'm also amending my advice to students in the future. Thanks to udev and the way things now work, it doesn't matter very much what
alias lines you have in your
/etc/modprobe.conf file; udev will start things up however seems fit.
Posted by lamontp at July 10, 2006 3:37 PM