Raspberry Pi 2 - Network connectivity on Ubuntu 22.04 LTS
Fixing ethernet, Wi-Fi drivers, interface naming, and hostname resolution when running Ubuntu on a Raspberry Pi 2.
TL;DR: This works out of the box with Raspberry Pi OS.
When installing Ubuntu on a Raspberry Pi 2, network connectivity doesn’t work out of the box the way it does with Raspberry Pi OS. Here’s how I got everything working.
Ethernet configuration
The wired connection didn’t come up automatically. I had to modify the Netplan configuration:
Edit /etc/netplan/50-cloud-init.yaml:
network:
version: 2
ethernets:
eth0:
dhcp4: true
optional: true
Apply the configuration:
sudo netplan apply
Wi-Fi drivers
The wireless adapter wasn’t recognized because the drivers weren’t included in the base image. Installing the extra kernel modules fixed it:
sudo apt install linux-modules-extra-raspi
After a reboot, the Wi-Fi interface appeared.
Interface naming
Ubuntu uses Predictable Network Interface Names by default, which gives interfaces names like enxb827eb1a2b3c instead of the familiar wlan0 and eth0. To switch back to traditional naming, add kernel parameters to /boot/firmware/cmdline.txt:
net.ifnames=0 biosdevname=0
Reboot for the change to take effect.
Hostname resolution
To enable .local hostname discovery (mDNS), install Avahi:
sudo apt install avahi-daemon
After these changes, network connectivity on the Raspberry Pi 2 with Ubuntu worked as expected — both wired and wireless, with proper hostname resolution on the local network.