What is the best way to stop CentOS 6 from renaming the eth0 interface to em1? I've googled a bit and found many relevant posts, but have still not come up with an elegant solution. One of the resources I found was http://www.arachnoid.com/linux/network_names/index.html, and while the Python script contained therein does create a new udev rule that renames em1 back to eth0 it feels kludgy and requires me to manually create the ifcfg-eth0 script. I'm looking for a way to stop udev from renaming the interface in the first place, preferably something that allows me to automate it via kickstart so that any new systems I deploy will have a permanent fix. I'll push a fix to any systems I already have deployed with CentOS 6 that have this problem.
On some of my systems I have a 70-persistent-net.rules file with a comment that says it was generated by /lib/udev/write-net-rules, but I don't remember what I did to get it generate that rule, much less how to automate it and get it to work reliably (on one of my systems I have that rule but the interface is sill named em1). BTW, the em1 name only appears to be an issue on my newer Dell desktops; the older IBM/Lenovo systems I support are all using eth0
Thanks, Alfred
On Thu, Apr 19, 2012 at 10:41:07AM -0400, Alfred von Campe wrote:
What is the best way to stop CentOS 6 from renaming the eth0 interface to em1?
I don't know when CentOS started doing this--I know when I did a fresh CentOS 6.x install (back when 6.x was first available), it didn't do it.
I believe the Fedora solutions should work.
http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming
Oops, that's not the solution.... that's here..
http://fedoraproject.org/wiki/Talk:Features/ConsistentNetworkDeviceNaming
On Apr 19, 2012, at 11:25, Scott Robbins wrote:
I don't know when CentOS started doing this--I know when I did a fresh CentOS 6.x install (back when 6.x was first available), it didn't do it.
I think you are right. My one new Dell system that doesn't use em1 is the oldest one which I installed before 6.2 was available (and possibly 6.1 as well).
Oops, that's not the solution.... that's here..
http://fedoraproject.org/wiki/Talk:Features/ConsistentNetworkDeviceNaming
Removing the biosdevname RPM sounds promising, and I'll test it with a kickstart install this afternoon. However, what's the best way to fix existing systems? If I just remove the biosdevname RPM and reboot, I don't think that eth0 will come up, as there is no ifcfg-eth0 script. Do I have to rename the ifcfg-em1 script and fix the DEVICE name inside the file? Or is there a way to regenerate the ifcfg-eth0 file from the command line?
BTW, I cannot find a single reference to the biosdevname binary in any of the startup scripts or udev rules, so I have no idea how it gets invoked in the first place, but I sure hope that removing it will fix this issue.
Alfred
On Thu, Apr 19, 2012 at 01:22:49PM -0400, Alfred von Campe wrote:
On Apr 19, 2012, at 11:25, Scott Robbins wrote:
http://fedoraproject.org/wiki/Talk:Features/ConsistentNetworkDeviceNaming
Removing the biosdevname RPM sounds promising, and I'll test it with a kickstart install this afternoon. However, what's the best way to fix existing systems? If I just remove the biosdevname RPM and reboot, I don't think that eth0 will come up, as there is no ifcfg-eth0 script. Do I have to rename the ifcfg-em1 script and fix the DEVICE name inside the file? Or is there a way to regenerate the ifcfg-eth0 file from the command line?
What I do is this for an existing one.
I change /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever it might be, e.g., eth0 and eth1).
Then, in the file itself, I edit the necessary line. (I think it's just one line, I don't have one here to look at, but IIRC, it's just the one line that uses pc1p1 or em1 or whatever, and I change that to, for example, eth0).
The other lines in the file should be fine--the ones referring to hardware address, IP, and so on.
As mentioned, I rename the file. One then removes the biosdevname package. I've never gotten it working without a reboot--service network restart doesn't work for me--on the other hand, I think I've only run into it with Fedora so far.
To further complicate matters, the last that I read, on virtual machines, it will continue to use eth0, eth1, and so on, rather than this new naming scheme.
Scott Robbins wrote:
On Thu, Apr 19, 2012 at 01:22:49PM -0400, Alfred von Campe wrote:
On Apr 19, 2012, at 11:25, Scott Robbins wrote:
http://fedoraproject.org/wiki/Talk:Features/ConsistentNetworkDeviceNaming
Removing the biosdevname RPM sounds promising, and I'll test it with a kickstart install this afternoon. However, what's the best way to fix existing systems? If I just remove the biosdevname RPM and reboot, I don't think that eth0 will come up, as there is no ifcfg-eth0 script. Do I have to rename the ifcfg-em1 script and fix the DEVICE name inside the file? Or is there a way to regenerate the ifcfg-eth0 file from the command line?
What I do is this for an existing one.
I change /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever it might be, e.g., eth0 and eth1).
Then, in the file itself, I edit the necessary line. (I think it's just one line, I don't have one here to look at, but IIRC, it's just the one line that uses pc1p1 or em1 or whatever, and I change that to, for example, eth0).
The other lines in the file should be fine--the ones referring to hardware address, IP, and so on.
As mentioned, I rename the file. One then removes the biosdevname package. I've never gotten it working without a reboot--service network restart doesn't work for me--on the other hand, I think I've only run into it with Fedora so far.
And with all of that, do *not* forget to edit /etc/udev/rules.d/70-persistent-net.rules
mark
From: "m.roth@5-cent.us" m.roth@5-cent.us
To: CentOS mailing list centos@centos.org Sent: Thursday, April 19, 2012 11:24 AM Subject: Re: [CentOS] Using eth0 on desktops with single network interface
Scott Robbins wrote:
On Thu, Apr 19, 2012 at 01:22:49PM -0400, Alfred von Campe wrote:
On Apr 19, 2012, at 11:25, Scott Robbins wrote:
http://fedoraproject.org/wiki/Talk:Features/ConsistentNetworkDeviceNaming
Removing the biosdevname RPM sounds promising, and I'll test it with a kickstart install this afternoon. However, what's the best way to fix existing systems? If I just remove the biosdevname RPM and reboot, I don't think that eth0 will come up, as there is no ifcfg-eth0 script. Do I have to rename the ifcfg-em1 script and fix the DEVICE name inside the file? Or is there a way to regenerate the ifcfg-eth0 file from the command line?
What I do is this for an existing one.
I change /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever it might be, e.g., eth0 and eth1).
Then, in the file itself, I edit the necessary line. (I think it's just one line, I don't have one here to look at, but IIRC, it's just the one line that uses pc1p1 or em1 or whatever, and I change that to, for example, eth0).
The other lines in the file should be fine--the ones referring to hardware address, IP, and so on.
As mentioned, I rename the file. One then removes the biosdevname package. I've never gotten it working without a reboot--service network restart doesn't work for me--on the other hand, I think I've only run into it with Fedora so far.
And with all of that, do *not* forget to edit /etc/udev/rules.d/70-persistent-net.rules
mark
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
This has piqued my curiosity. I haven't seen that behavior before, and I've done some recent installs of CentOS 6.0.
I use yum to upgrade them to CentOS 6.2. Maybe that's why....
But all my interfaces are named eth*. === Al
On Thu, Apr 19, 2012 at 2:35 PM, Al Sparks data345@yahoo.com wrote:
This has piqued my curiosity. I haven't seen that behavior before, and I've done some recent installs of CentOS 6.0.
I use yum to upgrade them to CentOS 6.2. Maybe that's why....
But all my interfaces are named eth*.
I think it is still only for certain Dell models and it probably only works with new 6.2 installs, but it is a badly needed capability to be able to predictably map the device/config names to the matching physical NICs.
I think it is still only for certain Dell models and it probably only works with new 6.2 installs, but it is a badly needed capability to be able to predictably map the device/config names to the matching physical NICs.
I was wondering about this because the T3500 I'm setting up with fresh 6.2 installs have eth0.
The whitepaper linked here
http://linux.dell.com/biosdevname/
explains it in detail, and indeed the T3500 is listed as not supporting under RHEL6.1 SMBIOS version is 2.5 according dmidecode and they say 2.6 is required.
On Thu, Apr 19, 2012 at 03:24:01PM -0400, m.roth@5-cent.us wrote:
Scott Robbins wrote:
What I do is this for an existing one.
I change /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever it might be, e.g., eth0 and eth1).
<snip>
And with all of that, do *not* forget to edit /etc/udev/rules.d/70-persistent-net.rules
Thank you Mark. As I think I've said, I only did it on Fedora, and interestingly enough, it doesn't have that file. (Or any persistent-net.rules in rules.d)
Scott Robbins wrote:
On Thu, Apr 19, 2012 at 03:24:01PM -0400, m.roth@5-cent.us wrote:
Scott Robbins wrote:
What I do is this for an existing one.
I change /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0
(or
whatever it might be, e.g., eth0 and eth1).
<snip> > > And with all of that, do *not* forget to edit > /etc/udev/rules.d/70-persistent-net.rules
Thank you Mark. As I think I've said, I only did it on Fedora, and interestingly enough, it doesn't have that file. (Or any persistent-net.rules in rules.d)
Yeah. I've had more than enough times of "it's not getting on the network... oh, it's eth4 or eth6 or...."
mark
On Apr 19, 2012, at 14:14, Scott Robbins wrote:
What I do is this for an existing one.
I change /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever it might be, e.g., eth0 and eth1).
I ended up writing a script to automate this on my CentOS 6 systems which looks like this:
#/bin/sh rpm -q biosdevname && yum erase -y biosdevname if [ -e /etc/sysconfig/network-scripts/ifcfg-em1 ]; then mv /etc/sysconfig/network-scripts/ifcfg-em1 /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i -e '/DEVICE=/s/em1/eth0/' /etc/sysconfig/network-scripts/ifcfg-eth0 fi
I've tested it on one system and it appeared to work fine, so I will deploy it to all my other systems over the weekend.
Alfred