6

Please, give me a clue, where it's located?

it's not under /etc/udev/rules.d anymore

# find / -name "*persistent-net.rules" didn't find anything...

Shirker
  • 579
  • 1
  • 5
  • 18

4 Answers4

9

Centos 7 and Redhat 7 by defaults uses biosdevname

rpm -qi biosdevname-0.5.0-10.el7.x86_64
Summary     : Udev helper for naming devices per BIOS names
Description :
biosdevname in its simplest form takes a kernel device name as an
argument, and returns the BIOS-given name it "should" be.  This is necessary
on systems where the BIOS name for a given device (e.g. the label on
the chassis is "Gb1") doesn't map directly and obviously to the kernel
name (e.g. eth0).
c4f4t0r
  • 5,149
  • 3
  • 28
  • 41
3

There is one more method to control network link names in RHEL/CentOS 7 with systemd.

Create new dir if it is absent:

mkdir /etc/systemd/network

Create new rule file in it. File extension must be .link, or it will be ignored

cat /etc/systemd/network/10-lan0.link
   [Match]
   MACAddress=00:50:56:b7:65:2b

   [Link]
   Name=lan0

Create configuration file for this interface:

cat /etc/sysconfig/network-scripts/ifcfg-lan0 
   IPADDR="192.168.6.8"
   GATEWAY="192.168.6.254"
   NETMASK="255.255.255.0"
   BOOTPROTO="static"
   DEVICE="lan0"
   ONBOOT="yes"
   IPV6INIT="no"

Here systemd.link(5) you could read description how to create custom rules, there are many options for naming. Also there are some examples. Unfortunately this man page systemd.link(5) is absent in RHEL7, but is works.

Here you could read about new common naming policy of network interfaces. You may change this policy for some interfaces in system or for all interfaces.

Sasha Golikov
  • 283
  • 2
  • 8
0

If it is not there, you can simply create it!

The rules will apply. Here is my example:

[root@WesternStar rules.d]# pwd

/etc/udev/rules.d

[root@WesternStar rules.d]# cat 70-persistent-net.rules |grep -v \#

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:4e:40:9a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

[root@WesternStar rules.d]#
c4f4t0r
  • 5,149
  • 3
  • 28
  • 41
Zatarra
  • 407
  • 3
  • 5
-2

Try /usr/lib/udev/rules.d/60-net.rules