[systemd-devel] Rename NIC by using dynamic MAC

Richard Maw richard.maw at codethink.co.uk
Thu Dec 3 07:31:53 PST 2015


On Thu, Dec 03, 2015 at 03:13:38PM +0000, Kaesbauer Michael wrote:
> Hi again, 
> 
> thanks for your quick reply.
> 
> Yes, I have many machines and each of those machines can have different number of NICs [2-4]. I want that the first NIC, at a specific port, has always the same NIC name. 

http://www.freedesktop.org/software/systemd/man/systemd.link.html#Path=
sounds like it would be more reliable for your case then.

> As the NIC name, produced by udev, changes when adding more NICs, I tried to
> solve that problem by adding my 81-net-rename.rules rule.
> By the way udev does not provide a predictable NIC name in my case, because
> the NICs do not supply any information to SMBIOS and therefore udev uses that
> PCI-name based NIC naming scheme.
> This is reason why the same NIC appears with NIC name " enp1s0"  when having
> 2 NICs in the machine, and appears with NIC name " enp3s0"  when having more
> than 2 NICs.

That's unfortunate, since this is exactly what the deterministic naming policy
is supposed to fix.

Ideally this would be fixed by having the kernel find some way of providing
some information to locate it by path.

There's also http://www.freedesktop.org/software/systemd/man/systemd.link.html#mac
which would let you name your interfaces by MAC,
which would at least let them have stable names per-machine.

> Is your suggestion with systemd.link files available when just having udev
> and no systemd (I have eudev)? At this case I think my script getMAC_DHCP.sh
> is also be needed.

I don't have any experience with eudev,
the fork may have happened before udev added .link file parsing support,
and I think it unlikely that eudev would backport .link file support.


More information about the systemd-devel mailing list