:: Re: [DNG] Ethernet names revisited
Etusivu
Poista viesti
Vastaa
Lähettäjä: Ralph Ronnquist
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] Ethernet names revisited
On 13/12 02:47, Antony Stone wrote:
> On Sunday 13 December 2020 at 01:09:18, Ralph Ronnquist via Dng wrote:
>
> > Well, the kernel modules makes the first naming, and assigns them as
> > eth0, eth1, eth2. That happens before udev starts.
> >
> > The kernel refuses any attempt to name an interface to, say, eth0 if
> > that name is taken.
> >
> > Those "facts" have been in effect since last millenium, so whatever
> > happened for you before would have happened within the eclipse of
> > those "facts".
>
> So... what's the correct way, in a current Devuan release, to ensure
> that each ethernet interface gets the name you want it to have,
> based on its MAC address (which, as far as I know, is the only
> uniquely identifiable thing about an interface, wherever it happens
> to be found, and in whatever order it gets identified)?


I wish I could tell you exactly: there are many different ways that
turn out to work well for some range of situations, but then not for
others.

Generally the first step is to use a different, unused name series,
say en0, en1, en2, with udev rules for mapping particular macaddress
to particular name.

If one could live with that, it would be a solution.

To map back into ethN requires another udev rule, but this rule must
not be in use until all the interfaces have been duly mapped (by the
above rules). If you use initrd the root pivot make a "stage barrier";
you can arrange the rules such that this mapping-back rule is checked
before the mapping forward rule for each interface, and thereby
achieve that the back mapping only happens at the post-pivot /sys
enumeration.

I'm sure there may be other ways to achieve the "stage barrier"; udev
is a programming language even if obscure.

>
> Antony.
>
> --
> Don't procrastinate - put it off until tomorrow.
>
>                                                    Please reply to the list;
>                                                          please *don't* CC me.