For When You Can't Have The Real Thing
[ start | index | login ]
start > CentOS > 6 > Revert To eth Device Names

Revert To eth Device Names

Created by dave. Last edited by dave, 4 years and 294 days ago. Viewed 1,715 times. #2
[diff] [history] [edit] [rdf]


I have a piece of software that expects my first ethernet device to be called eth0, not em1.


This worked for me.

  • add "biosdevname=0" to the kernel line in grub
  • create a /etc/udev/rules.d/70-persistent-net.rules with these two lines (make sure the MAC addresses are those from your interfaces, not these):
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="f8:b1:56:ca:f0:56", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:21:82:79", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
  • rename the ifcfg-em1 file to ifcfg-eth0 and edit appropriately (change the device name) and do the same for any other defined interfaces you have
Reboot and it should come up.



RedHat does >>some hand-waving saying that potentially this might be a bad idea, to the point of saying biosdevname=0 should be considered an install-time option. On the other hand it talks about removing the 70-persistent-net.rules file and that didn't exist for me. So bad things might be about to happen to me down the road, but so far I'm OK.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt