ThisCalculator

Everyday

Raspberry Pi Static IP: Setup and Router Options

Updated · Standard formula, shown below

Raspberry Pi Static IP: Setup and Router Options

A Raspberry Pi can use a static IP address either by reserving an address for it in your router or by configuring a fixed address on the Pi. A router reservation is usually the simplest choice for a home network; a manually configured address can be useful when the Pi must keep the same address even if the router changes.

What a static IP means

An IP address identifies a device on a network so other devices can connect to it. On a typical home network, the router assigns local addresses automatically using DHCP (Dynamic Host Configuration Protocol). The Pi may receive a different address after a restart, lease expiry, or network change.

A static address stays consistent. This is useful when you access a Pi over SSH, use it as a local server, or configure another device to connect to it. A private home-network address such as 192.168.1.50 is not the same as a public internet address: it is normally reachable only from your local network unless you separately configure remote access.

Choose a router reservation or a fixed address

For most people, reserve an address in the router. The router continues to manage DHCP but assigns the Pi the same address each time, usually by matching its network adapter’s MAC address. This reduces the chance of accidentally assigning the same address to two devices.

  • Router DHCP reservation: Recommended for most home networks. Manage it in the router’s settings, and the Pi can keep using automatic network configuration.
  • Static configuration on the Pi: The Pi requests or uses a chosen address directly. This may be suitable where the router has no reservation feature, but you must choose an unused address and enter the correct network details.
  • DHCP with no reservation: Easiest to set up, but the address can change, so it is less convenient for services other devices need to find reliably.

Do not configure the same address both as a router reservation for one device and as a manually assigned address for another. More broadly, make sure any manually chosen address is not inside a range the router may hand out to other clients, unless the router is configured to reserve or exclude it.

Find the Pi’s current network details

Before making changes, connect the Pi to the network and find its current address and route. In a terminal, run:

  • hostname -I displays the Pi’s assigned IP address or addresses.
  • ip route shows routing information; the line beginning with default via identifies the default gateway, commonly the router.
  • ip addr shows network interfaces and their addresses.

For example, if the Pi has 192.168.1.37 and the default route is 192.168.1.1, the router is likely using the 192.168.1.x subnet. These are examples, not values to copy blindly: routers may use other private ranges, including 10.x.x.x or 172.16.x.x.

Check the router’s DHCP settings and connected-device list as well. You need to know the subnet, the DHCP pool, and whether the address you want is already in use. Also identify whether the Pi connects over Ethernet or Wi-Fi; those interfaces have separate MAC addresses and may need separate reservations.

Reserve an address in the router

  1. Open the router’s administration page or app and sign in using the instructions supplied for that router.
  2. Find a section named something like DHCP reservation, Address reservation, or LAN clients. Exact labels differ by router.
  3. Select the Pi from the device list, or enter its MAC address. Confirm that you are reserving the address for the interface the Pi actually uses.
  4. Choose an available address on the router’s local subnet and save the reservation.
  5. Reconnect the Pi to the network or renew its DHCP lease, then check the address with hostname -I.

If a device list shows several similar entries, compare the MAC address with the Pi’s interface information from ip link. A Wi-Fi reservation will not necessarily apply when the Pi is connected through Ethernet, and vice versa. Router interfaces vary, so consult the router’s own documentation if the relevant setting is not obvious.

Configure a static address on Raspberry Pi OS

Raspberry Pi OS releases and network setups can use different network-management tools, so first check how the current system is configured rather than assuming one set of instructions fits every installation. On systems using NetworkManager, you can inspect connections with nmcli connection show. The graphical network settings may also provide IPv4 configuration options.

With NetworkManager, a connection can be set to manual IPv4 configuration using nmcli. The exact connection name and values are specific to your Pi and network; a typical command structure is:

sudo nmcli connection modify

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.