title: “Ubuntu Server Lost Network Connection After Reboot: How to Fix It” date: “2026-04-22T00:00:00.000Z” category: “Linux” tags: [“ubuntu”, “networking”, “homelab”, “troubleshooting”, “linux”]
You reboot your Ubuntu server and suddenly it’s unreachable. You can’t SSH in, your services are down, and nothing responds. You plug in a monitor and keyboard and see the server is running fine — but it has no IP address.
This happened to me and the fix took 5 minutes once I understood what was going on. Here’s exactly what happened and how to fix it.
What Happened
Ubuntu names network interfaces based on how the kernel detects them at boot. The name is usually something like enp2s0 or enp3s0 — the numbers refer to the PCI bus and slot where the network card is detected.
After a kernel update, hardware change, or sometimes even just a reboot, the kernel can detect the card in a different order or assign it to a different PCI slot ID. Your old interface enp2s0 simply doesn’t exist anymore — it’s now called enp4s0 or something else entirely.
Your netplan config still references the old name. No match = no network.
ip addr show shows no inet address on any interfaceStep 1 — Get Physical Access
Since you can’t SSH in, you need a monitor and keyboard connected directly to the server. Log in with your username and password.
Step 2 — Find the New Interface Name
ip link show
You’ll see output like this:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ...
2: enp4s0: <BROADCAST,MULTICAST> mtu 1500 ...
The interface with BROADCAST,MULTICAST is your ethernet card. In this case it’s now called enp4s0 instead of the old enp2s0.
You can also check:
ls /sys/class/net/
This lists all available network interfaces. Ignore lo (loopback). Your ethernet card is the other one.
Step 3 — Bring It Up Temporarily
Get your server back online immediately with these two commands:
# Replace enp4s0 with your actual interface name
sudo ip link set enp4s0 up
sudo dhclient enp4s0
Verify it worked:
ip addr show enp4s0
You should see an inet line with your local IP address (e.g. 192.168.1.136). You can now SSH in again and your services should come back up.
This fix is temporary — it won’t survive a reboot. Follow the next step to make it permanent.
Step 4 — Fix It Permanently via Netplan
Ubuntu uses Netplan to configure networking. The config file still has the old interface name. Let’s fix it:
# Find your netplan config file
ls /etc/netplan/
You’ll see a file like 00-installer-config.yaml. Edit it:
sudo nano /etc/netplan/00-installer-config.yaml
It probably looks something like this (with the old interface name):
network:
ethernets:
enp2s0: # ← old name, this is wrong
dhcp4: true
version: 2
Change it to your new interface name:
network:
ethernets:
enp4s0: # ← new name
dhcp4: true
version: 2
Apply the changes:
sudo netplan apply
Verify:
ip addr show enp4s0
Step 5 — Make It Future-Proof
The best way to prevent this happening again is to configure netplan to match by MAC address instead of interface name. The MAC address never changes even if the interface name does.
Find your MAC address:
ip link show enp4s0 | grep "link/ether"
# Output example: link/ether f6:b5:20:ff:fe:3a:95 brd ff:ff:ff:ff:ff:ff
Update your netplan config:
sudo nano /etc/netplan/00-installer-config.yaml
network:
ethernets:
ethernet0:
match:
macaddress: "f6:b5:20:ff:fe:3a:95" # ← your MAC address
set-name: ethernet0 # ← consistent name
dhcp4: true
version: 2
Apply:
sudo netplan apply
ip addr show ethernet0
Now even if the kernel assigns a different PCI slot name, netplan will find your card by MAC address and give it a consistent name ethernet0.
Bonus — Set a Static Local IP
While you’re in the netplan config, it’s worth setting a static local IP so your server always gets the same address on your home network. This prevents issues with DHCP leases expiring or changing.
network:
ethernets:
ethernet0:
match:
macaddress: "f6:b5:20:ff:fe:3a:95"
set-name: ethernet0
dhcp4: false
addresses:
- 192.168.1.136/24 # ← your preferred local IP
routes:
- to: default
via: 192.168.1.1 # ← your router IP
nameservers:
addresses:
- 1.1.1.1
- 8.8.8.8
version: 2
Apply and verify:
sudo netplan apply
ip addr show ethernet0
ip route show
ping 1.1.1.1
Quick Reference
Why Does This Happen?
Linux kernel versions change how they enumerate PCI devices. When Ubuntu installs a kernel update and reboots, the new kernel might detect your network card at a different PCI address than before — changing the interface name from enp2s0 to enp4s0.
It can also happen when you:
- Add or remove hardware (a GPU, USB card, etc.)
- Change which PCIe slot a card is in
- Update the kernel (most common cause)
- Change BIOS/UEFI settings that affect device enumeration
The MAC address approach in Step 5 is the permanent solution because the MAC address is burned into the network card’s firmware and never changes regardless of what the kernel calls it.
Summary
| Step | Command | Purpose |
|---|---|---|
| Find interface | ip link show | Identify the new name |
| Temporary fix | sudo ip link set IFACE up && sudo dhclient IFACE | Get online now |
| Permanent fix | Edit /etc/netplan/*.yaml | Survive reboots |
| Future-proof | Match by MAC address in netplan | Never breaks again |
Running a home lab means dealing with issues like this. Each one teaches you something. This particular fix took 5 minutes once I knew what to look for — hopefully this saves you the debugging time.