:: Re: [DNG] if2mac init.d service for…
Inizio della pagina
Delete this message
Reply to this message
Autore: Antony Stone
Data:  
To: dng
Oggetto: Re: [DNG] if2mac init.d service for persistent network interface names
On Wednesday 23 December 2020 at 21:56:09, aitor wrote:

> I can't understand the problem in the "Ethernet names revisited" thread,


The problem is when the kernel has decided to give your interfaces the names
you want them to have, but in the wrong order.

> because adding a new rule at the end (for example,
> 98-rename-net-devices.rules)
> containing suggested lines like:
>
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
> ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{type}=="1", KERNEL=="?*",
> NAME="new_name"
>
> is working for me.


You might want A=eth0, B=eth1, C=eth2

If the kernel decides A=eth1, B=eth2, C=eth0 then there's no way for udev
rules to rename them, because "File exists" (which should of course say
"Device name exists").

You have to first rename all ethX to somethingelseX, and then you can rename
them back again in the sequence of your choice.

Maybe you can do this in two separate udev rules files; I did it using one udev
rules file and network/interfaces.


Antony.

--
I have an excellent memory.
I can't think of a single thing I've forgotten.

                                                   Please reply to the list;
                                                         please *don't* CC me.