Fedora Linux Support Community & Resources Center
  #1  
Old 17th February 2013, 01:17 PM
bastani Offline
Registered User
 
Join Date: Jan 2012
Location: Lausanne
Posts: 31
linuxfirefox
How to get eth0 back?

Hello

I would like to have my laptop's network card named as "eth0" instead of "em1" (in Fedora 18 with kernel 3.7.7). Usually I did this by passing the kernel argument "biosdevname=0" at the boot time (in grub.cfg).

I am doing the same on this installation but I still get "em1" instead of "eth0". Even I removed the package biosdevname but it didn't help.

Any ideas on why this issue arises?

Thanks in advance!
Reply With Quote
  #2  
Old 17th February 2013, 01:31 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,501
linuxchrome
Re: How to get eth0 back?

There is a file /etc/sysconfig/networks-scripts/ifcfg-<interface>. Yours is probably still called ifcfg-em1 and the name of interface in the script is also probably listed as em1. While I make no guarantees, (and note that I don't use NetworkManager and for all I know it might choke if you do this) changing the name of the file and the name of the interface within the file works for me.
Reply With Quote
  #3  
Old 17th February 2013, 03:35 PM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,799
linuxfirefox
Re: How to get eth0 back?

'biosdevname' was a redhat-only parameter not in the recent kernels.
changing the ifcfg-* files in /ec/sysconfig/network* does not change the interface name.

You can rename interfaces using the 'ifrename' command.
Yes you'll need to revise the ifcfg-* files.

I suggest you learn to live with the current naming scheme.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #4  
Old 17th February 2013, 03:58 PM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,843
linuxopera
Re: How to get eth0 back?

As far as I can remember, the name is assigned by udev. You can change it in /etc/udev in one of the config files. Not hard to do.

KO went to look it up:
Quote:
[root@lazy ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x14e4:0x4315 (b43-pci-bridge)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:5e:eb:da:f4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

# PCI device 0x14e4:0x1713 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:9e:52:71:55", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# USB device 0x7392:0x7711 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1f:1f:a8:e1:e9", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
So, my interfaces are called eth0, wlan0 and wlan1. You can name yours whatever you want, then reboot to make it take effect.

Last edited by flyingfsck; 17th February 2013 at 05:19 PM.
Reply With Quote
  #5  
Old 17th February 2013, 06:27 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,501
linuxchrome
Re: How to get eth0 back?

Just tried a fresh F18 install. I let it install normally, that is, let it give the biosdevname.

I then did rpm -e biosdevname and rebooted. Upon reboot, the card showed as eth0. Stevea is right, what one does with /etc/sysconfig/network-scripts is irrelevant. The sysconfig/network-script file still read p2p1 and the device name in the file was still p2p1.
Reply With Quote
  #6  
Old 17th February 2013, 06:52 PM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,843
linuxfirefox
Re: How to get eth0 back?

The name can be set by a udev rule as shown above.
Reply With Quote
  #7  
Old 17th February 2013, 07:02 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 5,501
linuxchrome
Re: How to get eth0 back?

udev rules.d was empty. I was just trying to figure out the default at this point, or how little one needs to do to get eth0 as the name.
Reply With Quote
  #8  
Old 17th February 2013, 07:07 PM
bastani Offline
Registered User
 
Join Date: Jan 2012
Location: Lausanne
Posts: 31
linuxfirefox
Re: How to get eth0 back?

Thanks for all replies.

I tried to use ifrename but it complains about not being able to read the configuration file /etc/iftab. On the other side, in /etc/udev/rules.d/ I can only find 60-sysprof.rules which seems to be irrelevant; while I remember that I had found 70-persistent-net.rules in older installations of Fedora.

I am also surprised that I could get the old names back just one week ago on the same machine only by passing "biosdevname=0" while now I am not able to do so. I guess, as Stevea suggested, this parameter is no longer supported in the kernel.

---------- Post added at 08:07 PM ---------- Previous post was at 08:06 PM ----------

BTW: I need to have old names because some of software licenses I use (in particular MATLAB) need the traditional naming scheme.
Reply With Quote
  #9  
Old 20th February 2013, 02:11 AM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,799
linuxfirefox
Re: How to get eth0 back?

man iftab

tells you how to create the ifrename /etc/iftab file.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #10  
Old 20th February 2013, 02:52 AM
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 7,320
linuxfirefox
Re: How to get eth0 back?

The devices get renamed by udev. Look in /usr/lib/udev/rules.d/71-biosdevname.rules and you will see how it gets named. You could copy that file to /etc/udev/rules.d and make changes to it and over-ride what it does if you want to.
Reply With Quote
  #11  
Old 23rd March 2013, 02:22 PM
bastani Offline
Registered User
 
Join Date: Jan 2012
Location: Lausanne
Posts: 31
linuxfirefox
Re: How to get eth0 back?

Dear All,

After hours and days of struggling with the issue, it turned out the parameter biosdevname=0 should be passed when the installer boots for the first time, otherwise it would not be effective. If for any reasons one forgets to pass it at the first boot, the network configuration script at /etc/sysconfig/network-scripts would be created as ifcfg-em1 and (probably as a consequence) udev renames the device to em1 at the boot time (even without presence of the biosdevname package).

In this case, one has to additionally rename the scripts to ifcfg-eth0 and modify DEVICE=... line inside the script and reboot to get the old names back.

Thanks for al ideas and helps!
Reply With Quote
Reply

Tags
biosdevname, em1, eth0, fedora 18

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora "back in time" back up software & surveillance video macb6497 Using Fedora 2 15th September 2012 05:46 PM
OEL5.4 OS, eth0 has private IP, eth0:0 has routable IP, internet access don't work Hiroshi Servers & Networking 0 27th May 2010 09:20 PM
Back to back Connection of FC boxes. sosullivan Servers & Networking 3 12th October 2005 03:34 AM


Current GMT-time: 22:15 (Saturday, 30-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat