nmcli Command in Linux: Network Configuration, IP, DNS, Routing & Examples (RHEL/CentOS/Ubuntu)

Learn the nmcli command in Linux with syntax, options, and practical examples. Configure IP address (IPv4/IPv6), DNS, routing, hostname, bonding, bridging, and NetworkManager connections using nmcli on RHEL, CentOS, and Ubuntu systems.

Published

Updated

Read time 19 min read

Reviewed byDeepak Prasad

nmcli Command in Linux: Network Configuration, IP, DNS, Routing & Examples (RHEL/CentOS/Ubuntu)

The nmcli command is the fastest way to manage network settings in Linux directly from the terminal. Whether you want to configure IP, DNS, or troubleshoot connections, nmcli gives you full control without using GUI tools. This cheat sheet covers the most commonly used commands grouped by real-world scenarios.


nmcli command - Quick Cheat Sheet

Network Status & Device Information

Task Command
Check if NetworkManager is running nmcli -t -f RUNNING general
Show general network status nmcli general
List all network devices nmcli dev status
Show detailed device info nmcli dev show
Show active connections nmcli con show --active

Connection Management

Task Command
List all connections nmcli con show
Show connection details nmcli con show <name>
Add new connection nmcli con add con-name <name> type ethernet ifname <iface>
Modify connection nmcli con mod <name> <property> <value>
Rename connection nmcli con mod <old> connection.id <new>
Delete connection nmcli con del <name>
Reload configuration nmcli con reload

IP Address & DHCP Configuration

Task Command
Set static IP address nmcli con mod <name> ipv4.method manual ipv4.address <ip>/<prefix>
Set gateway nmcli con mod <name> ipv4.gateway <gateway>
Enable DHCP nmcli con mod <name> ipv4.method auto
Switch DHCP → Static nmcli con mod <name> ipv4.method manual ipv4.address <ip>/<prefix>
Switch Static → DHCP nmcli con mod <name> ipv4.method auto
Remove IP address nmcli con mod <name> -ipv4.addresses <ip>/<prefix>
Show IP address nmcli -g ip4.address con show <name>

DNS Configuration

Task Command
Set DNS server nmcli con mod <name> ipv4.dns <dns>
Add multiple DNS servers nmcli con mod <name> +ipv4.dns <dns>
Remove DNS servers nmcli con mod <name> -ipv4.dns <dns>
Ignore auto DNS from DHCP nmcli con mod <name> ipv4.ignore-auto-dns yes
Show DNS configuration nmcli -f ipv4.dns con show <name>

Interface Control & Connectivity

Task Command
Activate connection nmcli con up <name>
Deactivate connection nmcli con down <name>
Disconnect device nmcli dev disconnect <iface>
Reconnect device nmcli dev connect <iface>
Restart connection nmcli con down <name> && nmcli con up <name>

Routing & Advanced Network Settings

Task Command
Set default gateway nmcli con mod <name> ipv4.gateway <gateway>
Disable default route nmcli con mod <name> ipv4.never-default yes
Add static route nmcli con mod <name> +ipv4.routes "<network> <gateway>"
Remove static route nmcli con mod <name> -ipv4.routes "<network> <gateway>"
Set MTU nmcli con mod <name> 802-3-ethernet.mtu <mtu>
Bind MAC address nmcli con mod <name> 802-3-ethernet.mac-address <mac>

Monitoring & Debugging

Task Command
Monitor network changes nmcli monitor
Monitor specific connection nmcli con monitor <name>
Show selected fields nmcli -f ipv4.addresses,ipv4.dns con show <name>
Show full configuration nmcli con show <name>

Hostname Management

Task Command
Show hostname nmcli general hostname
Set hostname nmcli general hostname <new-hostname>

Bond, Bridge & Teaming (Advanced)

Task Command
Create bond interface nmcli con add type bond ifname bond0 mode active-backup
Add slave to bond nmcli con add type ethernet ifname eth1 master bond0
Create bridge nmcli con add type bridge ifname br0
Add interface to bridge nmcli con add type bridge-slave ifname eth1 master br0
Create team interface nmcli con add type team ifname team0

Compare nm-settings with ifcfg-* directives (IPv4)

nmcli con mod ifcfg-* file Effect
ipv4.method manual BOOTPROTO=none IPv4 address configured statically
ipv4.method auto BOOTPROTO=dhcp Obtain IPv4 configuration from DHCP server
ipv4.addresses "192.168.0.10/24" IPADDR=192.168.0.10 PREFIX=24 Set static IPv4 address and network prefix
ipv4.gateway 192.168.0.1 GATEWAY=192.168.0.1 Set IPv4 default gateway
ipv4.dns "8.8.8.8" DNS1=8.8.8.8 Modify /etc/resolv.conf to use this nameserver
ipv4.dns-search "example.com" DOMAIN=example.com Modify /etc/resolv.conf to use this domain in search directive
ipv4.ignore-auto-dns yes PEERDNS=no Ignore DNS server information provided by DHCP
connection.autoconnect yes ONBOOT=yes Automatically activate this connection on boot
connection.id eth0 NAME=eth0 The name of this connection
connection.interface-name eth0 DEVICE=eth0 Bind the connection to a specific network interface
802-3-ethernet.mac-address 08:00:27:4b:7a:80 HWADDR=08:00:27:4b:7a:80 Bind the connection to a specific MAC address
ipv4.never-default no DEFROUTE=yes Use this interface as default route (set to yes)

Compare nm-settings with ifcfg-* directives (IPv6)

nmcli con mod ifcfg-* file Effect
ipv6.method manual IPV6_AUTOCONF=no IPv6 is configured statically
ipv6.method auto IPV6_AUTOCONF=yes Will configure network settings using SLAAC from router advertisements
ipv6.method dhcp IPV6_AUTOCONF=no DHCPV6C=yes Will configure network settings using DHCPv6 (without SLAAC)
ipv6.addresses "2001:db8::a/64" ipv6.gateway "2001:db8::1" IPV6ADDR=2001:db8::a/64 IPV6_DEFAULTGW=2001:db8::1 Sets static IPv6 address and gateway
ipv6.dns "2001:4860:4860::8888" DNS1=2001:4860:4860::8888 Modify /etc/resolv.conf to use this nameserver
ipv6.dns-search "example.com" DOMAIN=example.com Modify /etc/resolv.conf to use this domain in the search directive
ipv6.ignore-auto-dns yes IPV6_PEERDNS=no Ignore DNS server information from DHCP
connection.autoconnect yes ONBOOT=YES Automatically activates the connection at boot
connection.id eth0 NAME=eth0 The name of this connection
connection.interface-name eth0 DEVICE=eth0 Bind the connection to a specific network interface
802-3-ethernet.mac-address 08:00:27:4b:7a:80 HWADDR=08:00:27:4b:7a:80 Bind the connection to a specific MAC address

How to Apply nmcli Changes Safely

After modifying network settings using nmcli, changes are not always applied immediately. You must explicitly apply them depending on the scenario.

text
nmcli con up <connection>
  • Applies updated configuration
  • Minimal disruption
  • Safe for production environments

Method 2: Restart Connection (Full Refresh)

text
nmcli con down <connection>
nmcli con up <connection>
WARNING
⚠️ If you are connected via SSH on this interface, your session will disconnect immediately. This must be executed directly from console.
  • Forces complete reinitialization
  • Useful when changes are not applied properly

Method 3: Device-Level Restart

text
nmcli dev disconnect <interface>
nmcli dev connect <interface>
WARNING
⚠️ If you are connected via SSH on this interface, your session will disconnect immediately. This must be executed directly from console.
  • Restarts the network interface itself
  • Useful for driver or interface-related issues

Method 4: Reload Configuration from Disk

text
nmcli con reload
  • Reloads connection profiles from disk
  • Does NOT apply changes to active connections
  • Use only after manual file edits

Method 5: Restart NetworkManager (Last Resort)

text
systemctl restart NetworkManager
WARNING
⚠️ This may restart all network services and disconnect all active sessions including SSH.
  • Restarts entire networking service
  • Use only when NetworkManager is unresponsive or stuck

Check NetworkManager Status and Devices

Check if NetworkManager is running

Verify whether NetworkManager service is active and managing network connections.

text
nmcli -t -f RUNNING general

Check overall NetworkManager state:

text
nmcli general

List all available network devices

Display all network interfaces (Ethernet, WiFi, loopback) along with their status.

text
nmcli dev status

Check physical network device status

View whether devices are connected, disconnected, or unmanaged.

text
nmcli device status

Display detailed device information

Get complete network configuration details such as IP address, DNS, and gateway.

text
nmcli dev show

To filter specific device:

text
nmcli dev show <interface>

Monitor connection and device activity

Monitor real-time network changes including connection events and device state updates.

Here in this example we will execute nmcli monitor for eth1 in one terminal, and on the other terminal we will make some modification to eth1 connection

text
nmcli con mod eth1 ipv4.method manual ipv4.address 10.10.10.4/24

As you see, after the modification, the monitor command gives below output

text
# nmcli con monitor eth1
eth1: connection profile changed

Manage Network Connections

List all available connections

Display all configured network connections along with UUID, type, and device.

text
nmcli con show

List configuration of a connection/interface

View complete configuration details of a specific network connection.

text
nmcli con show <connection>

Display selected fields from connection

You can list all the configured values of a connection using "nmcli con show <ifname>" but that gives you a long list of details, you can actually also get selected value of the provided directive of an individual connection

To get the IPv4 Address of eth1

text
# nmcli -g ip4.address connection show eth1
10.10.10.4/24

You can use -g to print values from specific fields using nmcli

text
# nmcli -g ip4.address,ipv4.dns connection show eth1
8.8.8.8,8.2.2.2
10.10.10.4/24

But here as you see we do not get a field to value mapping. You can use -f to specify what fields (column names) should be printed using nmcli. Valid field names differ for specific commands. List available fields by providing an invalid value to the --fields option.

text
# nmcli -f ipv4.dns,ipv4.addresses,ipv4.gateway con show eth1
ipv4.dns:                               8.8.8.8,8.2.2.2
ipv4.addresses:                         10.10.10.4/24
ipv4.gateway:                           10.10.10.1
HINT
You can choose these fields: ipv4.method, ipv4.dns, ipv4.dns-search, ipv4.dns-options, ipv4.dns-priority, ipv4.addresses, ipv4.gateway, ipv4.routes, ipv4.route-metric, ipv4.route-table, ipv4.ignore-auto-routes, ipv4.ignore-auto-dns, ipv4.dhcp-client-id, ipv4.dhcp-timeout, ipv4.dhcp-send-hostname, ipv4.dhcp-hostname, ipv4.dhcp-fqdn, ipv4.never-default, ipv4.may-fail, ipv4.dad-timeout

Interactively add or edit a connection

Use interactive mode to modify network settings step-by-step.

text
nmcli con edit <connection>

Rename an existing connection

Change the name of an existing connection without recreating it.

text
nmcli con mod <old-name> connection.id <new-name>

Delete a connection

Remove a network connection and its configuration from the system.

text
nmcli con del <connection>
WARNING
⚠️ Deleting an active connection will immediately disconnect the interface.

Activate and Control Connections

Use these nmcli commands to activate, deactivate, and safely control network connections without disrupting system connectivity.

Activate a connection

Use this command to bring up or activate a network connection. This applies configuration such as IP address, DNS, and routing.

text
nmcli con up <connection>

Deactivate a connection

Use this command to disconnect or deactivate a network connection from the system.

text
nmcli con down <connection>
WARNING
⚠️ If you are connected via SSH on this interface, your session will disconnect immediately.

Restart connection using nmcli

Restart a network connection to fully reinitialize the interface and apply all configuration changes.

text
nmcli con down <connection>
nmcli con up <connection>
WARNING
⚠️ This will temporarily disconnect the interface.

Safely apply configuration changes

In most cases, you can apply updated network settings without downtime by reactivating the connection.

text
nmcli con up <connection>

Recommended for production systems and remote sessions.


Configure Hostname

Use nmcli to view and change the system hostname configured through NetworkManager.

Check current hostname using nmcli

Display the current system hostname configured on the Linux machine.

text
nmcli general hostname

Change hostname using nmcli

Set a new hostname for the system using nmcli.

text
nmcli general hostname <new-hostname>

Verify the updated hostname:

text
hostname

Create and Configure Network Connections

Create ethernet connection with static IP address

Create a new network connection with static IPv4 and/or IPv6 configuration.

text
nmcli con add con-name <name> type ethernet ifname <iface> \
ipv4.method manual ipv4.address <ipv4>/<prefix> ipv4.gateway <gateway> \
ipv6.method manual ipv6.addresses <ipv6>/<prefix> ipv6.gateway <gateway>

Example:

text
nmcli con add con-name eth0 type ethernet ifname eth0 \
ipv4.method manual ipv4.address 192.168.1.10/24 ipv4.gateway 192.168.1.1 \
ipv6.method manual ipv6.addresses 2001:db8::10/64 ipv6.gateway 2001:db8::1

Create ethernet connection with DHCP IP address

Create a new connection using automatic IP configuration for IPv4 and IPv6.

text
nmcli con add con-name <name> type ethernet ifname <iface> \
ipv4.method auto ipv6.method auto

Example:

text
nmcli con add con-name eth0 type ethernet ifname eth0 ipv4.method auto ipv6.method auto

Modify existing connection configuration

Update existing network connection settings such as IP address, DNS, or gateway.

text
nmcli con mod <connection> <property> <value>

Examples:

text
nmcli con mod eth0 ipv4.dns 8.8.8.8
nmcli con mod eth0 ipv6.dns 2001:4860:4860::8888

Change connection interface binding

Bind a network connection to a specific network interface such as eth0 or ens33.

text
nmcli con mod <connection> connection.interface-name <interface>

Example:

text
nmcli con mod eth0 connection.interface-name ens33

Configure IP Address and Routing

Use nmcli to manage IPv4 and IPv6 addressing, gateway, and routing configuration.

Change connection from static IP to DHCP

Switch a manually configured (static) connection back to automatic configuration using DHCP. This allows the system to dynamically obtain IP address, subnet, gateway, and DNS from a DHCP server instead of relying on fixed values.

You can enable DHCP selectively depending on whether you want it for IPv4, IPv6, or both.

text
nmcli con mod <connection> ipv4.method auto ipv6.method auto

Example:

text
nmcli con mod eth0 ipv4.method auto ipv6.method auto

Apply changes using nmcli con up <connection>
Ensure DHCP is available, otherwise the interface may not get an IP.

Change connection from static IP to DHCP

Switch a manually configured (static) connection back to automatic configuration using DHCP. This allows the system to dynamically obtain IP address, subnet, gateway, and DNS from a DHCP server instead of relying on fixed values.

text
nmcli con mod <connection> ipv4.method auto ipv6.method auto

Example:

text
nmcli con mod eth0 ipv4.method auto ipv6.method auto

Apply changes using nmcli con up <connection>
Ensure DHCP is available, otherwise the interface may not get an IP.


Remove IP address from connection

Remove one or more configured IP addresses from a connection profile. This is useful when cleaning up incorrect static configurations or preparing to switch between static and DHCP setups.

text
nmcli con mod <connection> -ipv4.addresses <ipv4>/<prefix>
nmcli con mod <connection> -ipv6.addresses <ipv6>/<prefix>

Example:

text
nmcli con mod eth0 -ipv4.addresses 192.168.1.20/24
nmcli con mod eth0 -ipv6.addresses 2001:db8::20/64

Removing IP does NOT automatically enable DHCP — you must explicitly set ipv4.method auto or ipv6.method auto.


Set or modify default gateway

Configure or update the default gateway used for outbound traffic. The default gateway is required for communication outside the local subnet (e.g., internet access).

text
nmcli con mod <connection> ipv4.gateway <gateway>
nmcli con mod <connection> ipv6.gateway <gateway>

Example:

text
nmcli con mod eth0 ipv4.gateway 192.168.1.1
nmcli con mod eth0 ipv6.gateway 2001:db8::1

Incorrect gateway configuration can break external connectivity.


Change DEFROUTE directive (control default route)

Control whether a connection should be used as the default route for outbound traffic. This is especially useful in systems with multiple network interfaces.

text
nmcli con mod <connection> ipv4.never-default yes
nmcli con mod <connection> ipv6.never-default yes

Example:

text
nmcli con mod eth0 ipv4.never-default yes

Use this when you want another interface to act as the default gateway.


Add or remove static routes

Define custom static routes to reach specific networks through a given gateway. This is commonly used in advanced networking setups, multi-network environments, or segmented infrastructures.

Add route:

text
nmcli con mod <connection> +ipv4.routes "<network> <gateway>"
nmcli con mod <connection> +ipv6.routes "<network> <gateway>"

Remove route:

text
nmcli con mod <connection> -ipv4.routes "<network> <gateway>"
nmcli con mod <connection> -ipv6.routes "<network> <gateway>"

Example:

text
nmcli con mod eth0 +ipv4.routes "10.10.0.0/16 192.168.1.1"
nmcli con mod eth0 +ipv6.routes "2001:db8:1::/64 2001:db8::1"

Static routes are persistent and automatically applied whenever the connection is activated.

Configure DNS Settings

Use nmcli to configure DNS servers, search domains, and control whether DNS should be obtained automatically from DHCP or manually defined. This is essential for name resolution in both IPv4 and IPv6 networks.

Add or modify DNS server

Configure a DNS server for a connection. This replaces any existing DNS configuration with the new value.

text
nmcli con mod <connection> ipv4.dns "<dns1>"
nmcli con mod <connection> ipv6.dns "<dns1>"

Example:

text
nmcli con mod eth0 ipv4.dns "8.8.8.8"
nmcli con mod eth0 ipv6.dns "2001:4860:4860::8888"

This overwrites any existing DNS entries.

Append multiple DNS servers

Add one or more DNS servers without removing existing entries. Useful when configuring primary and secondary DNS servers.

  • Use +ipv4.dns to append IPv4 DNS servers
  • Use +ipv6.dns to append IPv6 DNS servers
text
nmcli con mod <connection> +ipv4.dns "<dns1> <dns2>"
nmcli con mod <connection> +ipv6.dns "<dns1> <dns2>"

Example:

text
nmcli con mod eth0 +ipv4.dns "8.8.8.8 8.8.4.4"
nmcli con mod eth0 +ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"

DNS servers are queried in order of priority.

Remove DNS servers

Remove configured DNS servers from a connection profile. This is helpful when correcting wrong entries or switching back to DHCP-managed DNS.

text
nmcli con mod <connection> -ipv4.dns "<dns>"
nmcli con mod <connection> -ipv6.dns "<dns>"

Example:

text
nmcli con mod eth0 -ipv4.dns "8.8.8.8"
nmcli con mod eth0 -ipv6.dns "2001:4860:4860::8888"

Removing all DNS entries may break hostname resolution unless DHCP DNS is enabled.

Ignore DNS provided by DHCP

Prevent the system from using DNS servers provided by DHCP. This is useful when you want to enforce custom DNS configuration.

  • Use ipv4.ignore-auto-dns yes for IPv4
  • Use ipv6.ignore-auto-dns yes for IPv6
text
nmcli con mod <connection> ipv4.ignore-auto-dns yes
nmcli con mod <connection> ipv6.ignore-auto-dns yes

Example:

text
nmcli con mod eth0 ipv4.ignore-auto-dns yes

Ensure manual DNS is configured, otherwise DNS resolution will fail.

Configure DNS search domain

Set domain names that will be automatically appended during hostname resolution (e.g., resolving server1 as server1.example.com).

text
nmcli con mod <connection> ipv4.dns-search "<domain>"
nmcli con mod <connection> ipv6.dns-search "<domain>"

Example:

text
nmcli con mod eth0 ipv4.dns-search "example.com"

Configure Network Behavior

These settings control how network connections behave during boot, reconnection, and interface-level configuration such as MTU and MAC binding.

Change ONBOOT / autoconnect directive

Control whether a connection should automatically activate when the system boots.

text
nmcli con mod <connection> connection.autoconnect yes

Example:

text
nmcli con mod eth0 connection.autoconnect yes

Equivalent to ONBOOT=yes in ifcfg files.

Enable or disable automatic connection

Enable or disable automatic activation of a connection when the interface becomes available.

text
nmcli con mod <connection> connection.autoconnect yes|no

Example:

text
nmcli con mod eth0 connection.autoconnect no

Disable IPv6 for a connection

Disable IPv6 completely for a network connection.

text
nmcli con mod <connection> ipv6.method disabled

Example:

text
nmcli con mod eth0 ipv6.method disabled

Disabling IPv6 may affect applications that rely on IPv6 connectivity.

Configure MTU for interface

Set Maximum Transmission Unit (MTU) size for a network interface. This controls packet size and can impact performance and fragmentation.

text
nmcli con mod <connection> 802-3-ethernet.mtu <mtu>

Example:

text
nmcli con mod eth0 802-3-ethernet.mtu 9000

Jumbo frames (MTU 9000) are used in high-performance networks.

Bind connection to MAC address

Bind a connection profile to a specific MAC address to ensure it is only applied to a particular network interface.

text
nmcli con mod <connection> 802-3-ethernet.mac-address <mac>

Example:

text
nmcli con mod eth0 802-3-ethernet.mac-address 08:00:27:4b:7a:80

Create and configure bond connection (active-backup)

Common bonding modes

Different bonding modes provide different behaviors such as redundancy, load balancing, or fault tolerance.

Mode Name Description
0 balance-rr Round-robin load balancing across all interfaces
1 active-backup Only one interface active, others standby (most common)
2 balance-xor Transmit based on hash policy (MAC/IP)
3 broadcast Sends traffic on all interfaces
4 802.3ad (LACP) Dynamic link aggregation (requires switch support)
5 balance-tlb Adaptive transmit load balancing
6 balance-alb Adaptive load balancing (no switch required)

active-backup is safest and widely used in production.
Modes like 802.3ad require switch-side configuration (LACP).

Network bonding combines multiple physical interfaces into a single logical interface for redundancy or performance. In active-backup mode, only one interface is active while others remain standby and take over during failure.

Step 1: Create bond interface

text
nmcli con add type bond ifname bond0 mode active-backup

Step 2: Add slave interfaces to bond

text
nmcli con add type ethernet ifname eth1 master bond0
nmcli con add type ethernet ifname eth2 master bond0

Step 3: Assign IP address (static or DHCP)

For DHCP:

text
nmcli con mod bond0 ipv4.method auto

For static IP:

text
nmcli con mod bond0 ipv4.method manual ipv4.address 192.168.1.10/24 ipv4.gateway 192.168.1.1

Step 4: Activate bond connection

text
nmcli con up bond0

After activation, traffic will flow through the active interface and automatically failover if it goes down.

Perform this configuration from console or secondary interface to avoid SSH disconnection.

Add slave interfaces to bond

Attach additional interfaces to an existing bond for redundancy or load balancing.

text
nmcli con add type ethernet ifname <iface> master bond0

Example:

text
nmcli con add type ethernet ifname eth3 master bond0

All slave interfaces must be in DOWN state before attaching.


Create and configure network bridge

A bridge allows multiple interfaces to act as a single Layer 2 network. It is commonly used in virtualization (KVM, containers) to connect VMs to the physical network.

Step 1: Create bridge interface

text
nmcli con add type bridge ifname br0

Step 2: Add interface to bridge

text
nmcli con add type ethernet ifname eth1 master br0

Step 3: Assign IP address to bridge

text
nmcli con mod br0 ipv4.method auto

IP should be assigned to bridge, not individual interfaces.

I have written another article with detailed steps to create and configure network bridge using nmcli and nmtui-based network bridge configuration separately on RHEL/CentOS 7 and 8 Linux.


Create and configure NIC teaming

Configure network teaming for load balancing and fault tolerance using modern kernel features.

text
nmcli con add type team ifname team0 config '{"runner": {"name": "activebackup"}}'

Example:

text
nmcli con add type team ifname team0 config '{"runner": {"name": "activebackup"}}'

Teaming is an advanced alternative to bonding with more flexibility.

I have written another article with detailed steps to create and configure NIC teaming with two slave interfaces using nmcli validated on RHEL/CentOS 7 and 8 Linux.


Reload and Apply Configuration

Use these commands to apply network configuration changes using nmcli without unnecessarily restarting services or disrupting connectivity. Understanding the difference between reload, reactivation, and restart is critical for production systems.

Reload connection using nmcli

Reload connection profiles from disk without applying them immediately. This is useful when configuration files (like ifcfg files) are modified externally.

text
nmcli con reload

This command only reloads saved connection profiles into NetworkManager. It does NOT apply the changes to active connections.

Use this when you manually edit configuration files and want NetworkManager to re-read them.

Apply changes using nmcli con up

Apply configuration changes by reactivating the connection. This is the safest and most commonly used method to apply updates like IP address, DNS, or gateway.

text
nmcli con up <connection>

Example:

text
nmcli con up eth0

This command:

  • Re-applies updated configuration
  • Does NOT require full restart of NetworkManager
  • Minimizes disruption compared to restart

If critical parameters (IP/gateway) are changed, your SSH session may disconnect.

Difference between reload and restart

Action Command What it does Impact
Reload nmcli con reload Reloads connection profiles from disk No impact on active connections
Reactivate nmcli con up <conn> Applies changes to a specific connection Minimal disruption
Restart NetworkManager systemctl restart NetworkManager Restarts entire network service High impact (all connections reset)

Most configuration changes only require nmcli con up, not a full restart.

When to restart NetworkManager (and when not to)

Restart NetworkManager only in specific scenarios where reload or reactivation is not sufficient.

When restart is required

  • NetworkManager service is stuck or unresponsive
  • Major configuration corruption or inconsistency
  • Kernel/network stack issues
  • Driver or interface-level failures
text
systemctl restart NetworkManager

When NOT to restart

  • Changing IP address (IPv4/IPv6)
  • Updating DNS configuration
  • Modifying routes or gateway
  • Switching DHCP ↔ static

In most cases, nmcli con up <connection> is sufficient and safer. Restarting NetworkManager will disconnect all active sessions, including SSH.


Summary

The nmcli command is a powerful and flexible tool to manage network configuration in Linux systems using NetworkManager. It allows administrators to create, modify, activate, and troubleshoot network connections without manually editing configuration files.

In this guide, you learned how to:

  • Inspect network devices and connection profiles
  • Configure IPv4 and IPv6 addressing (static and DHCP)
  • Manage DNS, routing, and default gateway settings
  • Control connection behavior such as autoconnect and MTU
  • Apply changes safely without restarting NetworkManager
  • Configure advanced networking like bonding, bridging, and teaming

Understanding when to use nmcli con reload, nmcli con up, and when to avoid restarting NetworkManager helps prevent unnecessary downtime, especially in production environments.


Official Documentation

Rohan Timalsina

is a technical writer and Linux enthusiast who writes practical guides on Linux commands and system administration. He focuses on simplifying complex topics through clear explanations.