[CentOS] Traditional network interface naming scheme vs. persistent naming

Niki Kovacs info at microlinux.fr
Wed Feb 4 19:00:36 UTC 2015


Le 04/02/2015 18:48, m.roth at 5-cent.us a écrit :
> That directory, and that file, exist in CentOS, also, since 6. And the new
> naming... it's*so*  much easier to deal with... yeah, right, I'll run the
> install, and wait till it hangs, so I can see that the NIC is named, what
> was it, on that HP last month, oh, yeah, I need to use ip -f inet link,
> far simpler than ifconfig, yes, it's ens3f0....
>
>          mark "why would I*possibly*  prefer a same-on-every-box eth0?"*
>
> * For the satire-impaired, this is satire.

LOL !!!

After a bit more experimenting, looks like I've found a clean solution 
for this. Simply create the /etc/udev/rules.d/70-persistent-net.rules 
file from scratch and edit it like this:

# /etc/udev/rules.d/70-persistent-net.rules
#
# eth0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \
   ATTR{address}=="00:1e:c9:42:84:7b", ATTR{type}=="1", \
   KERNEL=="eth*", NAME="eth0"
# eth1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \
   ATTR{address}=="00:30:f1:6a:2f:40", ATTR{type}=="1", \
   KERNEL=="eth*", NAME="eth1"

Reboot, and everything's working as expected.

Cheers,

Niki
-- 
Microlinux - Solutions informatiques 100% Linux et logiciels libres
7, place de l'église - 30730 Montpezat
Web  : http://www.microlinux.fr
Mail : info at microlinux.fr
Tél. : 04 66 63 10 32



More information about the CentOS mailing list