Static IP Address on Linux (Local Network)
This guide explains how to configure a static IP address on Linux so the computer always uses the same IP address inside the local network (LAN).
A static IP provides predictable and stable local networking.
It does not affect internet connectivity, VPN addresses, or public IPs.
Supported systems
This guide applies to most modern Linux distributions, including:
- Ubuntu
- Debian
- Fedora
- Arch Linux
- Linux Mint
- Raspberry Pi OS
Applies to systems using:
- Ethernet
- Wi-Fi
Important notice
Configuring a static IP changes how the Linux system connects to the local network.
Incorrect values may cause:
- Loss of local network connectivity
- Loss of internet access
- Inability to reach other devices on the LAN
Before continuing, make sure you know your current network information.
Required network information
Before configuring a static IP, you must know:
- Current local IP address
- Subnet mask (or CIDR prefix)
- Router (gateway) IP address
- DNS server addresses
- One free IP address in the same network range
If you do not know these values, follow this guide first:
→ How to find network information on Linux
Do not continue until you have this information.
Choosing a static IP address
The static IP you choose must:
- Be in the same subnet as the router
- Not be used by another device
- Preferably be outside the router’s DHCP range
Example network:
- Router IP:
192.168.1.1 - Subnet:
/24(255.255.255.0) - Valid static IP:
192.168.1.50
Avoid using:
- The router IP itself
- IPs already assigned to other devices
Configure a static IP on Linux
On modern Linux systems, static IP configuration is usually managed by NetworkManager or netplan, depending on the distribution.
This guide covers the most common approach using NetworkManager, which applies to most desktop distributions.
Identify the active network connection
First, list network connections:
nmcli connection show
Identify the active connection name, typically something like:
Wired connection 1Wi-Fi connection
You will need this name in the next steps.
Configure the static IP
Run the following commands, replacing values as needed.
Set manual IPv4 configuration
nmcli connection modify "CONNECTION_NAME" ipv4.method manual
Set IP address and subnet
Example for IP 192.168.1.50 with subnet /24:
nmcli connection modify "CONNECTION_NAME" ipv4.addresses 192.168.1.50/24
Set the router (gateway)
nmcli connection modify "CONNECTION_NAME" ipv4.gateway 192.168.1.1
Configure DNS servers
Example using public DNS servers:
nmcli connection modify "CONNECTION_NAME" ipv4.dns "1.1.1.1 8.8.8.8"
You may also use the router IP as DNS if preferred.
Apply the configuration
Restart the network connection:
nmcli connection down "CONNECTION_NAME" nmcli connection up "CONNECTION_NAME"
The connection may briefly disconnect and reconnect.
Common problems
No internet connection
- Verify the gateway IP address
- Check DNS server configuration
- Ensure the IP is within the correct subnet
IP address conflict
- Another device may already be using the same IP
- Choose a different unused IP and reapply the configuration