[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to compute predictable network interface names?



On 02/23/2017 04:25 PM, Christian Seiler wrote:
> 
> There's a policy which are going to be preferred. man 5 systemd.link
> tells you what the options are and /lib/systemd/network/99-default.link
> tells you what the default setting is (the first successful one is
> used).

Of course I stumbled over this one:

% man 5 systemd.link
No manual entry for systemd.link in section 5

Now I got confused: Who is responsible for renaming the NIC names?
Is this a systemd feature, is this the job of udev, or are the NICs
renamed by the kernel very early at boot time? Shouldn't I get the
same predictable name for eth0, no matter what?

> On my Stretch system that is:
> 
> NamePolicy=kernel database onboard slot path
> 

AFAIU
	NamePolicy=kernel

makes sure that net.ifnames=0 given on the kernel command line
works. Is this correct?

> 'kernel' and 'database' are likely going to fail in most cases (kernel
> means the kernel indicates that the name used so far is already
> predictable, which it only does for very special hardware, probably
> embedded or similar, and database means that there's an entry in the
> udev hardware database, which you'd have to do manually, because I
> don't know of any upstream rules), so basically it's the following
> logic:
> 
>  - first try ID_NET_NAME_ONBOARD
>  - if that doesn't exist, try ID_NET_NAME_SLOT 
>  - if that doesn't exist, try ID_NET_NAME_PATH
> 
Not to forget

- if that doesn't exist, use INTERFACE


Thanx very much for your detailed response.

Harri


Reply to: