A Raspberry Pi static IP ensures the Pi keeps the same address on the local network after every reboot, which is essential for SSH, web servers, NAS shares, Pi-hole, and any service that other devices need to reach at a predictable address. On Bookworm, the correct methods are a router DHCP reservation (recommended), nmcli, or nmtui. The /etc/dhcpcd.conf method used on Bullseye and earlier does not work on Bookworm because NetworkManager replaced dhcpcd as the network manager. Editing dhcpcd.conf on a Bookworm system has no effect.
Last tested: Raspberry Pi OS Bookworm Lite 64-bit | May 2025 | Raspberry Pi 4 Model B (4GB) | NetworkManager 1.42, nmcli 1.42
Key Takeaways
- Do not edit
/etc/dhcpcd.confon Bookworm. The dhcpcd daemon is not installed on Bookworm by default and NetworkManager does not read that file. Any guide that starts withsudo nano /etc/dhcpcd.confis describing the Bullseye method. On Bookworm it will either fail (file not found) or have no effect. - The router DHCP reservation method is the most reliable approach for all Pi models and all OS versions. The router assigns the same IP to the Pi’s MAC address every time. No Pi-side configuration is needed and the static address survives a full OS reinstall.
- Choose an IP address outside your router’s DHCP pool range to avoid conflicts. For example, if the router assigns DHCP addresses from 192.168.1.100 to 192.168.1.199, choose 192.168.1.50 for the Pi’s static address. Check the router’s DHCP settings to confirm the pool range before picking an address.
Method 1: Router DHCP Reservation (Recommended)
A DHCP reservation tells the router to always assign the same IP address to a specific device based on its MAC address. The Pi gets the address via normal DHCP at boot. No Pi-side configuration required. This method works on Bullseye, Bookworm, any Linux, and survives a full SD card reflash.

Find the Pi’s MAC address:
# Ethernet MAC address:
ip link show eth0 | grep ether
# WiFi MAC address:
ip link show wlan0 | grep ether
The MAC address is the 6-pair hex string (e.g., dc:a6:32:xx:xx:xx). Log into the router admin panel, typically at http://192.168.1.1 or http://192.168.0.1. Navigate to the DHCP reservation or static lease section. The exact location varies by router manufacturer. Common paths: Asus routers: LAN > DHCP Server > Manually Assigned IP; TP-Link: DHCP > Address Reservation; UniFi: Network > Client > Fixed IP. Enter the Pi’s MAC address and the desired IP address and save.
Reboot the Pi or renew the lease:
sudo nmcli connection down "Wired connection 1" && sudo nmcli connection up "Wired connection 1"
Expected result: hostname -I returns the reserved IP address. From another machine on the network, ping [pi-hostname] succeeds at the expected address. If the old IP is returned, the router may not have applied the reservation immediately. Reboot the Pi fully. If the hostname does not resolve, use the IP address directly while waiting for the router’s DNS cache to update.
Method 2: Raspberry Pi Static IP with nmcli on Bookworm
If router-side configuration is not available, use nmcli to configure a static IP directly on the Pi using NetworkManager. This works on Bookworm Lite and Desktop. Identify the active connection name first:
nmcli connection show
The output lists connections with their names. Ethernet connections are typically named Wired connection 1. WiFi connections show the SSID name. Use the exact name in the commands below.
Configure a static IP on the Ethernet connection (replace values with your network details):
# Set static IP, subnet mask, and gateway:
sudo nmcli con mod "Wired connection 1" \
ipv4.addresses "192.168.1.50/24" \
ipv4.gateway "192.168.1.1" \
ipv4.dns "192.168.1.1,8.8.8.8" \
ipv4.method manual
# Apply the changes:
sudo nmcli con up "Wired connection 1"
The /24 after the IP address is the subnet mask in CIDR notation (equivalent to 255.255.255.0 for a typical home network). The gateway is your router’s IP address, found with ip route | grep default. The DNS entry uses the router’s IP as the first DNS (which forwards to upstream) and 8.8.8.8 as a fallback. If Pi-hole or AdGuard Home runs on the network, use its IP as the primary DNS instead.
Expected result: ip addr show eth0 displays the configured static IP. hostname -I returns the new address. Internet connectivity works. If the Pi loses connectivity after applying the changes, the gateway IP is likely wrong. Revert to DHCP with sudo nmcli con mod "Wired connection 1" ipv4.method auto and confirm the correct gateway with ip route | grep default before re-applying.
To configure static IP on WiFi, use the SSID name as the connection name:
sudo nmcli con mod "YourWiFiSSID" \
ipv4.addresses "192.168.1.51/24" \
ipv4.gateway "192.168.1.1" \
ipv4.dns "192.168.1.1" \
ipv4.method manual
sudo nmcli con up "YourWiFiSSID"
Method 3: Raspberry Pi Static IP with nmtui
nmtui is a text-based menu interface for NetworkManager that runs in the terminal without needing to remember nmcli syntax. It is the most approachable Pi-side method for SSH sessions. Launch it:
sudo nmtui
Navigate with arrow keys and Enter. Select Edit a connection, choose the connection to edit (Wired connection 1 or the WiFi SSID), and press Enter. In the connection editor, navigate to the IPv4 Configuration section. Change <Automatic> to <Manual> using the arrow keys. Select <Add...> under Addresses and enter the IP address in CIDR notation (192.168.1.50/24). Fill in the Gateway and DNS Server fields. Tab to <OK> and press Enter to save.
Apply the change:
# Back in the main nmtui menu, select "Activate a connection"
# Deactivate and reactivate the connection to apply changes.
# Or restart NetworkManager:
sudo systemctl restart NetworkManager
Expected result: hostname -I returns the static IP after NetworkManager restarts. nmtui stores the configuration in NetworkManager’s connection files under /etc/NetworkManager/system-connections/. The setting persists across reboots automatically.
Verifying and Troubleshooting the Raspberry Pi Static IP
Verify the current IP address:
hostname -I # All IP addresses (concise)
ip addr show eth0 # Full interface details including subnet mask
ip route # Routing table including default gateway
Verify internet connectivity and DNS:
ping -c 3 8.8.8.8 # Test IP connectivity (bypasses DNS)
ping -c 3 google.com # Test DNS resolution
curl -s ifconfig.me # Confirm public IP (tests full network path)
Pi still gets a DHCP address after applying nmcli static IP. The connection name used in nmcli may not match the active connection. Run nmcli connection show --active to see what NetworkManager is actually using and re-run the nmcli commands with the correct name.
IP address conflict: another device already has the chosen address. Check for conflicts with sudo arp-scan -l (install with sudo apt install arp-scan). If another device uses the chosen address, either change the Pi’s address or assign a DHCP reservation on the router for that device too. Always pick an address outside the router’s DHCP pool range to prevent future conflicts.
Pi loses internet access after setting static IP. The gateway address is wrong. The gateway must be the router’s IP (not the Pi’s static IP). Find the correct gateway before making changes: ip route | grep default shows the gateway while DHCP is still active. Revert to DHCP with sudo nmcli con mod "Wired connection 1" ipv4.method auto && sudo nmcli con up "Wired connection 1".
dhcpcd.conf has no effect on Bookworm. As noted in the Key Takeaways, dhcpcd is not installed on Bookworm by default. NetworkManager handles all network configuration. If a previous guide had you edit /etc/dhcpcd.conf and the Pi is on Bookworm, those changes are being ignored. Use nmcli or nmtui instead.
For network monitoring and IP management across multiple Pi devices on a homelab network, see Raspberry Pi Network Setup: Complete WiFi and Ethernet Configuration Guide. For securing remote access to a Pi with a static IP, see Tailscale Raspberry Pi: Complete Secure Remote Access Guide.
FAQ
Does editing dhcpcd.conf work for Raspberry Pi static IP on Bookworm?
No. Raspberry Pi OS Bookworm uses NetworkManager rather than dhcpcd for network configuration. The /etc/dhcpcd.conf file either does not exist or is not read by NetworkManager. Any static IP set via dhcpcd.conf on a Bookworm system has no effect. Use the router DHCP reservation method, nmcli, or nmtui instead. The dhcpcd.conf method works on Bullseye and older Raspberry Pi OS releases only.
Should I use router DHCP reservation or nmcli for Raspberry Pi static IP?
Router DHCP reservation for most users. It requires no Pi-side configuration, works on any OS version, and survives a full SD card reflash. The Pi still uses DHCP at boot. The router simply always provides the same address for that MAC address. Use nmcli or nmtui when the router does not support DHCP reservations, or when managing many Pis and centralising all network configuration on the Pi itself is preferred.
How do I find my router’s IP address from Raspberry Pi?
Run ip route | grep default. The address after “via” is the router’s IP address (the default gateway). On most home networks this is 192.168.1.1 or 192.168.0.1, but it varies by router and ISP. This is the IP to use for the gateway field when configuring a static IP manually, and also the address of the router admin panel in a browser.
How do I avoid IP address conflicts when setting a Raspberry Pi static IP?
Choose an IP address outside the router’s DHCP pool range. Log into the router admin panel and check the DHCP server settings to see which range it uses (for example, 192.168.1.100 to 192.168.1.199). Choose an address outside that range (for example, 192.168.1.50) for the Pi. Scan the current network with sudo arp-scan -l to confirm no other device is already using the chosen address before applying it.
How do I revert a Raspberry Pi static IP back to DHCP?
With nmcli: sudo nmcli con mod "Wired connection 1" ipv4.method auto ipv4.addresses "" ipv4.gateway "" ipv4.dns "" then sudo nmcli con up "Wired connection 1". With nmtui: open the connection editor, change IPv4 Configuration back to Automatic, and save. For a router reservation: remove the reservation from the router admin panel and the Pi returns to receiving a dynamic DHCP address on the next boot or lease renewal.
References:
- NetworkManager nmcli documentation: networkmanager.dev/docs
- Raspberry Pi network configuration documentation: raspberrypi.com/documentation
- nmtui man page: linux.die.net/man/1/nmtui
- arp-scan: github.com/royhills/arp-scan
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 (4GB). Last tested OS: Raspberry Pi OS Bookworm Lite 64-bit. NetworkManager 1.42, nmcli 1.42.

