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.
This guide applies to most modern Linux distributions, including:
Applies to systems using:
Configuring a static IP changes how the Linux system connects to the local network.
Incorrect values may cause:
Before continuing, make sure you know your current network information.
Before configuring a static IP, you must know:
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.
The static IP you choose must:
Example network:
192.168.1.1/24 (255.255.255.0)192.168.1.50Avoid using:
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.
First, list network connections:
nmcli connection show
Identify the active connection name, typically something like:
Wired connection 1Wi-Fi connectionYou will need this name in the next steps.
Run the following commands, replacing values as needed.
nmcli connection modify "CONNECTION_NAME" ipv4.method manual
Example for IP 192.168.1.50 with subnet /24:
nmcli connection modify "CONNECTION_NAME" ipv4.addresses 192.168.1.50/24
nmcli connection modify "CONNECTION_NAME" ipv4.gateway 192.168.1.1
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.
Restart the network connection:
nmcli connection down "CONNECTION_NAME" nmcli connection up "CONNECTION_NAME"
The connection may briefly disconnect and reconnect.