← All commands
Topic hub Networking
Windows Linux Networking

Windows netsh int ip set address (static IP) equivalent in Linux

Assigns a permanent static IP address to a network interface using NetworkManager.

Windows netsh int ip set address (static IP)
Linux equivalents
Debian/Ubuntu apt / NetworkManager
nmcli con mod CONNECTION ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.method manual
Fedora dnf / NetworkManager
nmcli con mod CONNECTION ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.method manual
Arch pacman / NetworkManager
nmcli con mod CONNECTION ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.method manual

Overview

What this command does

Assigns a permanent static IP address to a network interface using NetworkManager.

Migration tip: ip addr add sets an IP temporarily (lost on reboot). For a permanent static IP use nmcli on desktop systems, or edit /etc/netplan/ on Ubuntu server.

Practical tasks

Common use cases

Configure a static IP address

Assigns a permanent static IP address to a network interface using NetworkManager.

ip addr add 192.168.1.50/24 dev eth0

Set IP temporarily

nmcli con mod 'Wired' ipv4.addresses 192.168.1.50/24

Set via NetworkManager (permanent)

nmcli con mod 'Wired' ipv4.method manual

Switch to static mode

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

nmcli con mod 'Wired connection 1' ipv4.addresses 192.168.1.50/24
nmcli con mod 'Wired connection 1' ipv4.gateway 192.168.1.1
nmcli con mod 'Wired connection 1' ipv4.dns '8.8.8.8 1.1.1.1'
nmcli con mod 'Wired connection 1' ipv4.method manual
nmcli con up 'Wired connection 1'

Walkthrough

Examples with explanations

# Windows: netsh int ip set address 'Ethernet' static 192.168.1.50 255.255.255.0

# Permanent via NetworkManager:
nmcli con mod 'Wired connection 1' ipv4.addresses 192.168.1.50/24
nmcli con mod 'Wired connection 1' ipv4.gateway 192.168.1.1
nmcli con mod 'Wired connection 1' ipv4.dns '8.8.8.8 1.1.1.1'
nmcli con mod 'Wired connection 1' ipv4.method manual
nmcli con up 'Wired connection 1'

Reference

Common options and variations

Command or optionUse
ip addr add 192.168.1.50/24 dev eth0Set IP temporarily
nmcli con mod 'Wired' ipv4.addresses 192.168.1.50/24Set via NetworkManager (permanent)
nmcli con mod 'Wired' ipv4.method manualSwitch to static mode
nmcli con up 'Wired'Apply changes

Distro differences

Debian/Ubuntu vs Fedora vs Arch

This command can differ by distro defaults or package manager.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu apt / NetworkManager nmcli con mod CONNECTION ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.method manual Desktop installs often use NetworkManager; servers may use Netplan.
Fedora dnf / NetworkManager nmcli con mod CONNECTION ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.method manual NetworkManager is the normal Fedora path.
Arch pacman / NetworkManager nmcli con mod CONNECTION ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.method manual Use this if NetworkManager is installed and enabled.

Keep learning

Related Networking commands