Xenial: impossible to rename an interface with a .link file

Bug #1579969 reported by Francois Lafont
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Hi,

Impossible to rename an interface with a .link file in a updated Ubuntu Xenial. It's a fresh and basic install without GUI, just a ssh server (it's a VirtualBox VM).

Here is my environment:

-------------------------------------------
root@xenial-clean:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial
-------------------------------------------

According to the manpage "systemd.link" (example 2), I can rename an interface with a .link file like this:

-------------------------------------------
root@xenial-clean:~# ll /etc/systemd/network/10-eth0.link
-rw-r--r-- 1 root root 57 May 10 02:07 /etc/systemd/network/10-eth0.link

root@xenial-clean:~# cat /etc/systemd/network/10-eth0.link
[Match]
MACAddress=08:00:27:be:14:c2

[Link]
Name=eth0
-------------------------------------------

Currently the interface name is enp0s3 because the OS is not yet rebooted:

-------------------------------------------
root@xenial-clean:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:be:14:c2 brd ff:ff:ff:ff:ff:ff
-------------------------------------------

And now I reboot the OS. But, after the reboot, the interface name is still enp0s3:

-------------------------------------------
root@xenial-clean:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:be:14:c2 brd ff:ff:ff:ff:ff:ff
-------------------------------------------

Just for information:

-------------------------------------------
root@xenial-clean:~# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.4.0-22-generic root=UUID=03363c3a-58b5-4398-82a8-6997ec1a00e5 ro quiet splash

root@xenial-clean:~# apt-cache policy systemd
systemd:
  Installed: 229-4ubuntu4
  Candidate: 229-4ubuntu4
  Version table:
 *** 229-4ubuntu4 500
        500 http://fr.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
-------------------------------------------

Note: the .link file is taken into account _only_ if I set the "net.ifnames=0" kernel boot parameter. But, according to the manpage "man systemd.link", this is normally not necessary.

Regards.

Revision history for this message
Francois Lafont (francois-lafont) wrote :

Sorry impossible to attach my "apport" file. If I try, the "Submit" button works no longer.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Francois Lafont (francois-lafont) wrote :

Just for information, I have retried the test with a Xenial 16.04.1 (instead of 16.04) in a fresh install of a VM and the problem still exists.

Regards.

Dan Streetman (ddstreet)
Changed in systemd (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.