0

My Ubuntu desktop 16.04 machine has udev rules:

user@desktop:~$ sudo tree /etc/udev/
/etc/udev/
├── hwdb.d
├── rules.d
│   ├── 48-adwits.rules
│   ├── 49-stlinkv1.rules
│   ├── 49-stlinkv2-1.rules
│   ├── 49-stlinkv2.rules
│   ├── 49-stlinkv3.rules
│   ├── 51-android.rules
│   ├── 60-uv4l.rules
│   ├── 65-uv4l_uvc.rules
│   ├── 70-persistent-net.rules
│   └── 85-lpcxpresso.rules
└── udev.conf

2 directories, 11 files
user@desktop:~$ cat /etc/udev/rules.d/70-persistent-net.rules 
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="f8:b1:56:e8:1b:f4", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"

but I have two Ubuntu 16.04 server machines which have no rules:

user@server1:~$ sudo tree /etc/udev/
/etc/udev/
├── hwdb.d
├── rules.d
└── udev.conf

2 directories, 1 file

These servers have four ethernet interfaces each, which are not enumerated in the same order:

Server 1:

user@server1:~$ cat /proc/net/bonding/bond* | egrep '(Interface|HW addr)'
Slave Interface: eth0
Permanent HW addr: 34:17:eb:eb:d7:32
Slave Interface: eth1
Permanent HW addr: 6c:b3:11:1b:b5:76
Slave Interface: eth2
Permanent HW addr: 34:17:eb:eb:d7:33
Slave Interface: eth3
Permanent HW addr: 6c:b3:11:1b:b5:77

Server 2:

user@server2:/etc/udev$ cat /proc/net/bonding/bond* | egrep '(Interface|HW addr)'
Slave Interface: eth0
Permanent HW addr: 34:17:eb:ea:f3:3e
Slave Interface: eth1
Permanent HW addr: 34:17:eb:ea:f3:3f
Slave Interface: eth2
Permanent HW addr: 6c:b3:11:1c:ac:68
Slave Interface: eth3
Permanent HW addr: 6c:b3:11:1c:ac:69

The two servers have enumerated their eth interfaces differently. On server one eth0/eth2 and eth1/eth3 are the names of the dual-nic cards, whereas on server2 its eth0/eth1 and eth2/eth3.

How can I make these servers generate 70-persistent-net.rules files, so that I can edit those to make the two servers have the same interface names for the same rj45 socket positions?

Is there a particular udev package in the desktop release which is missing on the server release, and responsible for the nearly-empty /etc/udev tree?

P.S. The fourth and fifth bytes of all mac addresses have been changed for security, but the leading (manufacturer) bytes, and the last byte have been left alone.

1 Answer 1

1

Ähm, Udev rules from system are in /lib/udev/rules.d/. Otherwise you would not be able to boot.

dpkg -L udev

Is one of the Server an upgrade from trusty? Since systemd version 204 cannonical dropped 75-persistent-net-generator.rules and others. systemd 204

But own rules in /etc/udev/rules.d are read by udev.

4
  • I'm using net.ifnames=0 biosdevname=0 to boot the kernel. Does this mean that there is no way to ensure that eth0..3 are the same sockets on each boot?
    – fadedbee
    Dec 5, 2019 at 9:00
  • Are the netcards all the same? Or different?
    – nobody
    Dec 5, 2019 at 9:41
  • Dual NICs on the motherboard, from DELL (34:17:eb), dual NICs on an expansion card, from Shenzhen Lianrui Electronics (6c:b3:11). The problem is that server 1's motherboard NICs are eth0 and eth2, while server 2's motherboard NICs are eth0 and eth1 (and similar confusion for expansion card NICs).
    – fadedbee
    Dec 5, 2019 at 10:36
  • please follow me to chat. If you want. chat.stackexchange.com/rooms/101835/…
    – nobody
    Dec 5, 2019 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .