Public bug reported:

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.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1579969

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1579969/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to