Raspberry Pi network setup on Bookworm uses NetworkManager rather than the deprecated dhcpcd stack. The practical tools are Raspberry Pi Imager for headless first-boot configuration, and nmcli for all subsequent changes including static IP assignment, Wi-Fi credentials, and dual-interface configuration. This guide covers both interfaces from first boot through static IP configuration, with the correct Bookworm commands throughout.
Last tested: Raspberry Pi OS Bookworm Lite 64-bit | May 3, 2026 | Raspberry Pi 4 Model B | Raspberry Pi 5 | NetworkManager 1.44
Key Takeaways
- On Bookworm,
dhcpcdis replaced by NetworkManager. The/etc/dhcpcd.conffile does not exist by default andsudo systemctl restart dhcpcdwill fail. Usenmclifor all network configuration including static IP assignment. - The
wpa_supplicant.confheadless Wi-Fi method is deprecated since Bullseye and does not work on Bookworm. Configure Wi-Fi credentials during imaging using Raspberry Pi Imager’s advanced settings, or usenmcliafter first boot. - For a server Pi that other devices depend on (DNS resolver, VPN server, NAS), use a DHCP reservation in your router rather than a static IP configured on the Pi itself. A router reservation achieves the same stable address with no risk of address conflicts if the Pi’s configuration is ever reset.
Raspberry Pi Network Setup: Ethernet vs Wi-Fi
Ethernet is the correct choice for any Pi running as a permanent server. Wired connections eliminate the latency variability and occasional dropouts that affect Wi-Fi, provide full Gigabit bandwidth, and do not compete with other wireless clients for airtime. Pi 4 and Pi 5 both have Gigabit Ethernet ports that connect directly to a router or switch.
Wi-Fi is appropriate for Pi deployments where running a cable is impractical. A Pi Zero 2 W embedded in a project enclosure, a Pi in a location without nearby Ethernet, or a Pi used as a portable device. The Pi 4 and Pi 5 support 2.4GHz and 5GHz 802.11ac. For a server running Jellyfin, Home Assistant, Pi-hole, or any service where reliability matters, use Ethernet.
| Scenario | Recommended interface | Reason |
|---|---|---|
| Permanent server (DNS, NAS, VPN) | Ethernet | Reliability, full bandwidth, no dropouts |
| Portable or embedded project | Wi-Fi | No cable required |
| Dual interface (server with Wi-Fi backup) | Both active | Failover or separate traffic paths |
| Pi Zero 2 W | Wi-Fi only | No Ethernet port on this model |
Headless First-Boot Setup with Raspberry Pi Imager
The cleanest way to configure networking on a headless Pi is before the first boot using Raspberry Pi Imager. Download Imager from raspberrypi.com/software, flash Raspberry Pi OS Bookworm Lite 64-bit, and open the advanced settings with Ctrl+Shift+X (or click the gear icon).
In the advanced settings:
- Set hostname (e.g.,
raspberrypi) - Enable SSH and select “Allow public-key authentication only” and paste your SSH public key
- Set username and password
- Configure wireless LAN: enter SSID and password, set country code (e.g., US)
Flash the card, insert it into the Pi, and power on. After 30 to 60 seconds the Pi is reachable over SSH at its hostname or DHCP-assigned IP. The Wi-Fi credentials from Imager are written as a NetworkManager connection profile and work on Bookworm without any additional configuration.
Expected result: ssh pi@raspberrypi.local (or ssh pi@<ip-address>) connects successfully. Run nmcli device status to see both the Ethernet and Wi-Fi interfaces and their connection state.

Configuring Ethernet with a Static IP
After first boot, confirm the Ethernet interface name and current IP assignment:
ip link show
# Note your Ethernet interface name: eth0 on Pi 4, end0 on Pi 5
nmcli device status
# Shows all interfaces, their type, state, and active connection name
nmcli connection show
# Lists all saved connection profiles
Set a static IP on the Ethernet interface. Replace end0 with your actual interface name and adjust the IP address to match your network:
sudo nmcli connection modify "Wired connection 1" ipv4.method manual ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1
sudo nmcli connection up "Wired connection 1"
Verify the change took effect:
ip a show eth0
# or: ip a show end0
# Should show the static IP address you set
Expected result: The interface shows the static IP. ping -c 4 1.1.1.1 succeeds. ping -c 4 google.com also succeeds, confirming DNS resolution is working through the gateway.
To revert to DHCP:
sudo nmcli connection modify "Wired connection 1" ipv4.method auto
sudo nmcli connection up "Wired connection 1"
Configuring Wi-Fi from the Command Line
If Wi-Fi was not configured during imaging, add it with nmcli:
# List available Wi-Fi networks
nmcli device wifi list
# Connect to a network (creates a saved profile)
sudo nmcli device wifi connect "YourSSID" password "YourPassword"
Expected result: NetworkManager connects and the Wi-Fi interface shows a DHCP-assigned IP. The connection profile is saved and reconnects automatically after reboot.
To connect to a hidden SSID:
sudo nmcli connection add type wifi con-name "hidden-network" ssid "HiddenSSID" wifi-sec.key-mgmt wpa-psk wifi-sec.psk "YourPassword" 802-11-wireless.hidden yes
sudo nmcli connection up "hidden-network"
To set a static IP on Wi-Fi (same pattern as Ethernet):
sudo nmcli connection modify "YourSSID" ipv4.method manual ipv4.addresses 192.168.1.101/24 ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1
sudo nmcli connection up "YourSSID"
Running Both Ethernet and Wi-Fi Simultaneously
Both interfaces can be active at the same time. The most common reason to do this is a Pi that normally uses Ethernet but needs Wi-Fi as a fallback when the cable is disconnected, or a Pi that needs to bridge two network segments.
By default, when both interfaces have a default route, packets may route unpredictably. Set a metric to prefer Ethernet:
# Set Ethernet as higher priority (lower metric = higher priority)
sudo nmcli connection modify "Wired connection 1" ipv4.route-metric 100
sudo nmcli connection modify "YourSSID" ipv4.route-metric 600
# Apply changes
sudo nmcli connection up "Wired connection 1"
sudo nmcli connection up "YourSSID"
# Verify routing table
ip route show
Expected result: ip route show shows the default route via Ethernet (metric 100) before the Wi-Fi default route (metric 600). Traffic goes through Ethernet when the cable is connected and falls back to Wi-Fi automatically if the Ethernet link drops.
Troubleshooting
Pi not found on the network after first boot
# Scan for the Pi from another device on the network
# On Linux/macOS:
nmap -sn 192.168.1.0/24 | grep -i raspberry
# Or check the router's DHCP client list for a new device
If the Pi does not appear after 90 seconds, the most common causes are: wrong Wi-Fi credentials in Imager (re-flash with correct credentials), SSH not enabled in Imager (re-flash with SSH enabled), or the Pi is on Ethernet but you are scanning the wrong subnet. Confirm which network the Pi is on by connecting a monitor and checking ip a on the console.
nmcli connection modify has no effect
# Check the exact connection name (it must match exactly)
nmcli connection show
# If the connection name contains spaces, quote it:
sudo nmcli connection modify "Wired connection 1" ...
# After modifying, always bring the connection up to apply:
sudo nmcli connection up "Wired connection 1"
The most common mistake is modifying the connection but not running nmcli connection up to apply the changes. NetworkManager saves the change to its profile but does not automatically reapply it to the live interface until you bring the connection up.
Wi-Fi disconnects after some time
# Disable Wi-Fi power management (common cause of intermittent drops)
sudo iw dev wlan0 set power_save off
# Make it permanent
sudo tee /etc/NetworkManager/conf.d/wifi-powersave-off.conf <<EOF
[connection]
wifi.powersave = 2
EOF
sudo systemctl restart NetworkManager
No internet after setting static IP
# Confirm default route exists
ip route show | grep default
# Test gateway reachability
ping -c 4 192.168.1.1
# Test DNS resolution
nslookup google.com
If the gateway ping fails, the static IP address or subnet mask is wrong. Confirm the gateway IP matches your router LAN IP. If gateway ping succeeds but DNS fails, the ipv4.dns value in the connection profile is wrong or unreachable. Set it to your router’s IP or a public resolver like 1.1.1.1.
Interface name is not eth0
Pi 5 uses end0 for its Ethernet interface rather than eth0. Pi 4 uses eth0. Always check the actual interface name with ip link show before running nmcli commands. The NetworkManager connection profile name (“Wired connection 1”) is separate from the kernel interface name and does not change between Pi models.
FAQ
How do I find my Pi’s IP address?
Run ip a on the Pi to see all assigned IP addresses. For the Ethernet interface, look for the address under eth0 or end0. For Wi-Fi, look under wlan0. From another device on the network, run nmap -sn 192.168.1.0/24 or check the router’s DHCP client list. Most routers show a list of connected devices with hostnames and IPs in their admin interface.
Should I use a static IP on the Pi or a DHCP reservation on the router?
A DHCP reservation in the router is generally the better approach for server Pis. The router assigns the same IP to the Pi’s MAC address every time, without any configuration on the Pi itself. This means the Pi continues to get a stable IP even if you re-flash the OS. A static IP configured on the Pi is the right choice when you do not have access to the router’s DHCP settings, or when running a Pi on a network you do not control.
Does Bookworm still support wpa_supplicant.conf for headless Wi-Fi setup?
No. The wpa_supplicant.conf headless Wi-Fi method was deprecated in Bullseye and removed in Bookworm. Placing a wpa_supplicant.conf file in the boot partition has no effect on Bookworm. Use Raspberry Pi Imager advanced settings to configure Wi-Fi credentials before first boot, or use nmcli after connecting via Ethernet or a console cable.
Can I use both Ethernet and Wi-Fi on the same Pi at the same time?
Yes. Both interfaces can be active simultaneously. Configure route metrics to control which interface handles outbound traffic by default. Ethernet should have a lower metric (higher priority) than Wi-Fi for a server Pi that uses Wi-Fi only as a fallback.
How do I change the DNS server on Bookworm?
Set the DNS server in the NetworkManager connection profile using nmcli:
sudo nmcli connection modify "Wired connection 1" ipv4.dns "192.168.1.53"
sudo nmcli connection up "Wired connection 1"
Replace 192.168.1.53 with the IP of your Pi-hole or AdGuard Home instance. See Unbound Raspberry Pi and AdGuard Home Raspberry Pi for DNS filtering setups.
References
- https://www.raspberrypi.com/software/
- https://networkmanager.dev/docs/api/latest/nmcli.html
- https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-networking
About the Author
Chuck Wilson has been programming and building with computers since the Tandy 1000 era. His professional background includes CAD drafting, manufacturing line programming, and custom computer design. He runs PidiyLab in retirement, documenting Raspberry Pi and homelab projects that he actually deploys and maintains on real hardware. Every article on this site reflects hands-on testing on specific hardware and OS versions, not theoretical walkthroughs.
Last tested hardware: Raspberry Pi 4 Model B, Raspberry Pi 5 (8GB). Last tested OS: Raspberry Pi OS Bookworm Lite 64-bit. NetworkManager 1.44.

