[SOLVED] mga4: iftab, 70-persistent-net.rules ignored!

[SOLVED] mga4: iftab, 70-persistent-net.rules ignored!

Postby magfan » Mar 7th, '14, 15:23

Finally I dared to upgrade from mga3 -> mga4. But what I did not expect happened: the configuration of the network is completely mixed up. Except for eth0 all other ports (eth1-5) are attached to different mac addresses than before. The files /etc/iftab and /etc/udev/rules.d/70-persistent-net.rules are completely ignored! How can I change this behavior?
Last edited by magfan on Mar 13th, '14, 13:04, edited 1 time in total.
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby unklar » Mar 7th, '14, 15:49

delete them
Code: Select all
rm /etc/udev/rules.d/70-persistent-net.rules
and reboot
unklar
 
Posts: 40
Joined: Apr 10th, '12, 20:30

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby magfan » Mar 7th, '14, 16:11

Did not work. Still except for eth0 all interfaces are mixed. It is a pity because I need the correct port names for software licenses. Changing network cables is not an option in our hospital...
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby jkerr82508 » Mar 7th, '14, 18:51

Predictable Network Device naming was not enforced in an upgrade from Mageia 3 to Mageia 4. To have it used, delete (or move) the files 70-persistent-net.rules and 80-net-name-slot.rules (the latter is a symlink) from /etc/udev/rules.d and restart the system. (At least this worked for me.)

If you wish to use custom names rather than the defaults, then see the penultimate section of this page:

http://www.freedesktop.org/wiki/Softwar ... faceNames/

So far as I know iftab is no longer used.

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby magfan » Mar 10th, '14, 12:23


Well, according to the new naming scheme the ports on my system should not be called eth* at all. But they are still called like that. I just cannot rename them any more. It looks like a mix of new and old naming scheme. And none of the four proposed options works:

The problem is that a specific port name should belong to a specific hardware port (mac address). I have done that before via "/etc/iftab". My file "/etc/udev/rules.d/70-persistent-net.rules" did not work as expected (option 2) and I do not understand how I could change the new file "/etc/udev/rules.d/80-net-setup-link.rules" so that it does what I want. On my system it is a link to "/dev/null" (option 1). I would like to remove that link and create a file instead (option 3). But with what content?

Finally, passing "net.ifnames=0" to the kernel does not work as well (option 4).
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby Latte » Mar 10th, '14, 19:24

Does this help you? (the 'Change Device name' section)
User avatar
Latte
 
Posts: 142
Joined: Apr 3rd, '11, 14:44

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby jkerr82508 » Mar 10th, '14, 20:09

This is what I used to successfully rename my network device, but I only have one network device on each of my systems.

$ cat /etc/udev/rules.d/70-my-net-names.rules
# rename device enp0s10
SUBSYSTEM=="net", ACTION=="add", ATTR{address}==".....", NAME="lan"

(I've removed the MAC address from that quote)

I assume, but can't test, that adding corresponding entries for each device, using the appropriate MAC addresses and names should be what is required. I did find that it is essential to use lower case letters in the MAC address, otherwise udev refuses to recognise the name change.

It is also necessary to delete the existing 70-persistent-net.rules and 80-net-name-slot.rules files from /etc/udev/rules.d

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby magfan » Mar 12th, '14, 12:34

None of the solutions worked. Still my Mageia system names the ports eth0-5. Just by accident eth0 is the same device as before. That is why it keeps the same name. But the other ports are mixed. What I really do not understand is that the system has two ports on its mainboard (before upgrade: eth0, eth1) and four ports on a PCIe card (before upgrade: eth2-5). Besides the fact that according to the new naming scheme the ports should not be called eth* at all the numbering order is strange. It starts on the mainboard (eth0), continues on the PCIe card (eth1-4), and finally switches back to the mainboard (eth5, formerly eth1). If I cannot rename the ports easily, can I maybe influence the numbering order? I would be already happy with: first all mainboard ports, then all PCIe card ports.
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby jkerr82508 » Mar 12th, '14, 13:16

magfan wrote:None of the solutions worked. Still my Mageia system names the ports eth0-5.

Please post the output from:
Code: Select all
ls -l /etc/udev/rules.d
and the content of the rules file (if any) that you created to rename the devices.

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby magfan » Mar 12th, '14, 13:39

The first two lines in "10-network.rules" belong to the mainboard ports, the remaining four lines belong to the PCIe card. The original mac addresses have been partly replaced by "mainboard" and "pcie_card" because these parts are identical for the ports on the mainboard and for the ports on the PCIe card:
Code: Select all
# ls -l /etc/udev/rules.d/
insgesamt 4
-rw-r--r-- 1 root root 468 Mär 12 12:10 10-network.rules
# cat /etc/udev/rules.d/10-network.rules
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="mainboard:d5:51:75",NAME="eth0"
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="mainboard:e0:9f:d2",NAME="eth1"
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="pcie_card:3d",NAME="eth2"
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="pcie_card:3c",NAME="eth3"
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="pcie_card:3f",NAME="eth4"
SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="pcie_card:3e",NAME="eth5"
#

Just before I forget. Here is what the system says:
Code: Select all
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether mainboard:d5:51:75 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether pcie_card:3d brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether pcie_card:3c brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether pcie_card:3f brd ff:ff:ff:ff:ff:ff
6: eth4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether pcie_card:3e brd ff:ff:ff:ff:ff:ff
7: eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether mainboard:e0:9f:d2 brd ff:ff:ff:ff:ff:ff
#
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby jkerr82508 » Mar 12th, '14, 15:32

If /etc/udev/rules.d is empty, does Mageia still use ethx names? So far as I know, it should not, and I can't think, offhand, of an explanation for it doing so, but that should probably be resolved before creating a custom rules file.

Both of the links:
https://wiki.archlinux.org/index.php/Ne ... evice_name
http://www.freedesktop.org/wiki/Softwar ... faceNames/
warn that using device names ethx can lead to race conditions on boot and is not recommended.

If you must use ethx device names, then you may find this thread of some help.
https://bbs.archlinux.org/viewtopic.php?id=155641
(It suggests that it may be possible to continue using ifrename and iftab.)

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: upgrade mga4: iftab, 70-persistent-net.rules ignored!

Postby magfan » Mar 13th, '14, 13:03

OK. Finally I decided to skip any names of the form eth* to avoid problems with kernel names. Then I did the following:

1. create ifcfg-* files for all named ethernet ports (not inside /etc/sysconfig/network-scripts/ !)
2. remove any ifcfg* file from /etc/sysconfig/network-scripts/
3. create a file "70-my-net-names.rules" with my preferred "mac address : name" combinations (not inside /etc/udev/rules.d/ !)
4. remove any file from /etc/udev/rules.d/
5. reboot
6. verified that all ethernet ports are named according to the new naming scheme (OK!)
7. remove any new ifcfg* file from /etc/sysconfig/network-scripts/
8. copy the previously created ifcfg* files from step 1 to /etc/sysconfig/network-scripts/
9. copy the previously created 70-my-net-names.rules from step 3 to /etc/udev/rules.d/
10. reboot

Now all ethernet ports have the names I wanted them to have. About the license file for a specific commercial software package I have to ask. Maybe they will change "eth0" to another name. But for me this topic is solved. Thanks a lot!
magfan
 
Posts: 332
Joined: Apr 3rd, '12, 12:33


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron