You are not logged in.

#1 2015-10-25 23:27:31

OlafLostViking
Member
From: Lost
Registered: 2013-01-30
Posts: 59

[SOLVED] rename interfaces with systemd-networkd

Hi!

I wanted to rename a network interface using the systemd provided machanisms but am failing...

I created a .link file but systemd is not renaming the interface:

[Match]
OriginalName=eth0
#OriginalName=ens*
[Link]
Name=netext
$ journalctl -b | grep -A3 rename
Oct 26 00:16:27 minntooine kernel: virtio_net virtio2 ens18: renamed from eth0
Oct 26 00:16:27 minntooine kernel: input: PC Speaker as /devices/platform/pcspkr/input/input20
Oct 26 00:16:27 minntooine systemd[1]: Found device /dev/vda2.
Oct 26 00:16:27 minntooine systemd[1]: Mounting /boot...

So systemd is renaming the interace before it mounts the root filesystem. Is it impossible for systemd to rename the interface again after it is booting the system? And if yes, shouldn't the initramfs take care of these things (like including the config with mkinitcpio)? Or am I simply doing something wrong?

Thanks

Last edited by OlafLostViking (2015-10-26 08:52:26)

Offline

#2 2015-10-25 23:37:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] rename interfaces with systemd-networkd

Where did you get those variables?  I believe "Name" is used for a match parameter, not something to be set.

If you want to rename your interface, follow this:
http://www.freedesktop.org/wiki/Softwar … faceNames/


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-10-26 00:08:21

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED] rename interfaces with systemd-networkd

What did you name your .link file? It needs to have a lexically earlier name than "99-default.link".

I use MACAddress rather than OriginalName in my files, and both of mine work fine. E.g.

$ cat /etc/systemd/network/50-wired0.link
[Match]
MACAddress=aa:bb:cc:dd:ee:ff 

[Link]
Description=Top Ethernet Port
MACAddressPolicy=persistent 
Name=wired0
$ 

Offline

#4 2015-10-26 08:52:05

OlafLostViking
Member
From: Lost
Registered: 2013-01-30
Posts: 59

Re: [SOLVED] rename interfaces with systemd-networkd

Thank you both for your answers!

Trilby wrote:

Where did you get those variables?  I believe "Name" is used for a match parameter, not something to be set.

With the enries in the [Link] category you can change the settings of the interface matched by the parameters in the [Match] settings.


ukhippo wrote:

I use MACAddress rather than OriginalName in my files

This is a rented VM and I don't really trust my provider to keep the MAC address constant ;-)

ukhippo wrote:

What did you name your .link file? It needs to have a lexically earlier name than "99-default.link".

Ha, great! Thank you - I did the mistake of not taking care of the order! After I renamed the file to have a number prefix it works. smile

Offline

Board footer

Powered by FluxBB