Score:0

After upgrade of ubuntu network interface names changed, why? How to change back?

cn flag

After an upgrade from 18.04 to 20.04 I found all the network interface names changed. Why? And how can I change them back to their original names without having to edit netplan files to force a name.

ChanganAuto avatar
us flag
Why do you think it's a good idea to change them back?
Dave avatar
cn flag
It completely broke my netplan configuration because I had the older names still in netplan yaml. This subsequently broke iSCSI network connections.
Score:2
cn flag

Why

It is called predictable network interface names.

Fron the link:

he classic naming scheme for network interfaces applied by the kernel is to simply assign names beginning with "eth0", "eth1", ... to all interfaces as they are probed by the drivers. As the driver probing is generally not predictable for modern technology this means that as soon as multiple network interfaces are available the assignment of the names "eth0", "eth1" and so on is generally not fixed anymore and it might very well happen that "eth0" on one boot ends up being "eth1" on the next. This can have serious security implications, for example in firewall rules which are coded for certain naming schemes, and which are hence very sensitive to unpredictable changing names.

And how can I change them back to their original names without having to edit netplan files to force a name.

I would suggest not to do that. This naming is predictable :-) The old one was buggy and could mess network names up if one come up slower than a similar type nic.

But yes you can. Also from the link:

I don't like this, how do I disable this?

You basically have three options:

  1. You disable the assignment of fixed names, so that the unpredictable kernel names are used again. For this, simply mask udev's .link file for the default policy: ln -s /dev/null /etc/systemd/network/99-default.link

  2. You create your own manual naming scheme, for example by naming your interfaces "internet0", "dmz0" or "lan0". For that create your own .link files in `/etc/systemd/network/, that choose an explicit name or a better naming scheme for one, some, or all of your interfaces. See systemd.link(5) for more information.

  3. You pass the net.ifnames=0 on the kernel command line

Dave avatar
cn flag
Thanks for the details. Your instructions are helpful for changing names after the fact.
Score:0
cn flag

Found out that after upgrading from 20.04 to 22.04 all the interfaces names went back. That is what I was looking for how to make the interface names not change.

The problem I believe was from a failed SNAP install of lxd during the upgrade from 18.04 to 20.04. (Re: home directory placements. More info found here)

I think after I fixed that a reboot would have fixed the problem. However I ended up doing an upgrade to the latest version which required a reboot anyway.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.