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:

Applies to systems using:


Important notice

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.


Required 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.


Choosing a static IP address

The static IP you choose must:

Example network:

Avoid using:


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:

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


IP address conflict