Upgrading Ubuntu from 16.04 to 20.04 often breaks Ethernet connectivity because the network manager no longer uses the legacy ifupdown system by default, leaving interfaces like enp0s31f6 and eth1 unconfigured. To resolve this, you must either configure Netplan for the new interface names or restore the classic networking stack if your hardware relies on older driver behaviors.
Understanding the Interface Naming Shift
The primary reason your internet connection disappears after a major version jump is the transition in how Linux identifies network hardware. In Ubuntu 16.04, network interfaces were typically assigned predictable names based on their physical location, such aseth0 or eth1. However, starting with Ubuntu 17.10 and continuing through 20.04, the system adopted Predictable Network Interface Names (Freedesktop standard). This means your Ethernet port might now appear as enp0s31f6, which encodes the bus path of the device rather than a simple sequential number.
If you are seeing both enp0s31f6 and eth1 active but without internet access, it indicates a conflict between the new naming convention and legacy configuration files. The system may be trying to bring up an interface that doesn't exist under its old name, or the NetworkManager service is failing to recognize the new identifier. This specific scenario is common when migrating from older LTS releases where manual edits to /etc/network/interfaces were standard practice.
For more details on handling multiple interfaces during upgrades, see Lost Internet Connection After Upgrading Ubuntu 20.04.6: Two Different Interfaces named en01 and eth1.
Diagnosing the Current State
Before applying fixes, you need to verify exactly what the operating system sees. Open a terminal and run the commandip link show. This will list all network devices along with their state. Look for your Ethernet adapter. It should ideally show as UP if the cable is connected and the driver is loaded. If it shows as DOWN, the interface is physically detected but not enabled.
Next, check if the kernel has loaded the appropriate driver. Run dmesg | grep -i ethernet or look for messages containing the chipset name (e.g., Intel I219, Realtek RTL8111). If you see errors related to firmware missing or module loading failures, the issue is deeper than just configuration. However, since you are upgrading from 16.04, it is highly likely that the driver is present but the network manager is confused by the name change.
You can also check the status of the NetworkManager service with systemctl status NetworkManager. If the service is active but reports "no connections found," it confirms that the configuration files do not match the available hardware interfaces.
Checking Legacy Configuration Files
In older Ubuntu versions, administrators edited/etc/network/interfaces to define static IPs or DHCP settings. In Ubuntu 20.04, this file is largely ignored unless you have explicitly installed the ifupdown package and disabled NetworkManager. Check if this file contains entries for eth1. If it does, but your current system sees the interface as enp0s31f6, the system will fail to apply those settings.
If you find stale entries for eth0 or eth1 in this file, they should generally be commented out or removed unless you are intentionally running in legacy mode. Leaving them there while NetworkManager tries to manage the new names can cause race conditions where neither service successfully claims the interface.
Solution 1: Configuring Netplan
Ubuntu 20.04 uses Netplan for network configuration. These configurations are stored as YAML files in the/etc/netplan/ directory. You will typically find a file ending in .yaml, such as 01-netcfg.yaml or 50-cloud-init.yaml. Open this file with a text editor using sudo, for example: sudo nano /etc/netplan/01-netcfg.yaml.
Ensure the configuration references the correct interface name. If your interface is enp0s31f6, the YAML structure should look like this:
network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
dhcp4: true
If you previously used a static IP, replace dhcp4: true with the appropriate addresses and gateway4 fields. Note that indentation is critical in YAML; use spaces, not tabs. Once saved, apply the changes with sudo netplan apply. If the command fails, it will output the syntax error, allowing you to correct the file immediately.
Solution 2: Restoring Legacy Networking
If your workflow depends heavily on the oldifupdown method, or if Netplan continues to fail despite correct syntax, you can revert to the traditional networking stack. First, disable NetworkManager to prevent conflicts: sudo systemctl disable --now NetworkManager. Then, install the necessary packages: sudo apt install ifupdown resolvconf.
After installation, edit /etc/network/interfaces to define your interface. Use the actual name shown by ip link show. For example:
auto enp0s31f6
iface enp0s31f6 inet dhcp
Finally, restart the networking service with sudo systemctl restart networking. This approach bypasses the modern abstraction layer entirely, providing a direct link between the configuration file and the kernel interface. This is particularly useful for servers or specialized hardware setups where predictable behavior is prioritized over dynamic management features.
For insights on managing kernels and boot partitions during such complex transitions, refer to Upgrading Ubuntu: Checking Installed Kernels in the Boot Partition.
Solution 3: Resetting Network Manager
Sometimes the issue is not the configuration file but the cached state of NetworkManager. You can try resetting the entire network stack by removing the cache and restarting the service. Runsudo rm /var/lib/NetworkManager/NetworkManager.state followed by sudo systemctl restart NetworkManager. This forces the manager to re-scan all available interfaces and re-read its configuration files from scratch.
This method is less invasive than changing configuration systems and often resolves issues where the interface name changed but the underlying connection profile remained attached to the old name. If you had previously created a connection profile named "Wired connection 1" linked to eth0, this reset helps clear orphaned references.
Frequently Asked Questions
Why does my interface name change after an upgrade?
Ubuntu switched to predictable interface names in version 17.10 to ensure consistent identification across different hardware permutations. This prevents issues whereeth0 might swap with eth1 if a USB dongle is plugged in, making enp0s31f6 the stable standard for desktop installations.
Can I force the old eth0 naming scheme?
Yes, you can add the kernel parameternet.ifnames=0 biosdevname=0 to your GRUB configuration. Edit /etc/default/grub, append these to GRUB_CMDLINE_LINUX_DEFAULT, and run sudo update-grub. Rebooting will revert names to the legacy style, though this is generally discouraged for new deployments.
What if Netplan apply gives me a syntax error?
YAML is extremely sensitive to whitespace. Ensure you are using spaces for indentation and that your colons are followed by a space. You can validate your YAML file online or use tools likeyamllint before applying. A single tab character will cause the command to fail silently or throw a parsing error.
How do I check if my Ethernet driver is loaded?
Use the commandlspci -k | grep -A 2 -i network. This lists PCI network devices and the kernel driver currently bound to them. If the driver column is empty, the device is not being recognized by the OS, which may require installing additional firmware packages via ubuntu-drivers autoinstall.
Is it safe to remove NetworkManager?
Removing NetworkManager is safe if you have a robust alternative likesystemd-networkd or ifupdown configured correctly. However, on a desktop environment, NetworkManager provides essential features for Wi-Fi switching, VPN integration, and automatic DNS management. Disabling it may reduce convenience even if wired connectivity is restored.