netplan set-name option not working on freshly installed Ubuntu server 18.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
=== bug description ===
Need to change network card kernel assigned name (enp0s15) to a more meaningful one (eth_lan).
Using set-name option in netplan config (matching device by MAC address) does not work.
=== versions ===
# lsb_release -rd
Description: Ubuntu 18.04 LTS
Release: 18.04
# uname -a
Linux server 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
# apt-cache policy netplan
netplan:
Installed: (none)
Candidate: 1.10.1-5build1
Version table:
1.10.1-5build1 500
500 http://
=== test case ===
Set netplan configuration like this:
# cat /etc/netplan/
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
# original network card name: enp0s15
id0:
match:
macaddress: xx:xx:xx:xx:xx:xx
set-name: eth_lan
addresses:
- 10.0.0.10/24
gateway4: 10.0.0.254
nameservers:
addresses: [ 8.8.8.8, 8.8.4.4 ]
=== expected behavior ===
Network card renamed to "eth_lan" and assigned the IP address 10.0.0.10
=== actual behavior ===
This is network state after reboot:
# ip -4 address
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: enp0s15: <BROADCAST,
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
As you can see, after reboot the interface is still named enp0s15 and was not assigned the static IP address.
=== workaround ===
If I manually run "netplan apply" just after reboot, the device is renamed and configuration is applied correctly:
# ip -4 address
1: lo: <LOOPBACK,
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
3: eth_lan: <BROADCAST,
inet 10.0.0.10/24 brd 10.0.0.255 scope global eth_lan
valid_lft forever preferred_lft forever
description: | updated |
Changed in netplan: | |
status: | Incomplete → Confirmed |
tags: | added: sts |
I have the same issue as the reporter. Interface does not rename and does not come up automatically after reboot, need to run 'netplan apply'.
I use interface renaming on basically all my virtual machines so it's immediately clear what is connected to what network/vlan. I'm now back to ifupdown together with udev renaming like I've been using for years now, which is fine for me but you probably want to get this fixed :)
** netplan config **
# This file describes the network interfaces available on your system
addresses:
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
inet1:
match:
macaddress: xx:xx:xx:xx:xx:xx
set-name: inet1
addresses: [ xxxxx/28 ]
gateway4: xxxxxx
nameservers:
search: [ xxxxx ]
- "xxxx"
- "xxxx"
** And tried this as well (same behavior) **
# This file describes the network interfaces available on your system
addresses:
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens3:
match:
macaddress: xx:xx:xx:xx:xx:xx
set-name: inet1
inet1:
addresses: [ xxxxx/28 ]
gateway4: xxxxxx
nameservers:
search: [ xxxxx ]
- "xxxx"
- "xxxx"