NetworkManager is the default network management stack on RHEL 8, and nmcli is its fully-featured command-line interface. Using nmcli, administrators can create, modify, activate, and delete network connections entirely from the terminal — no GUI or .ifcfg file editing required. This tutorial covers inspecting current network state, configuring a static IP address, managing connections, and using nmtui as a text-based alternative. The low-level ip command is also covered for verifying the resulting network configuration.
Prerequisites
- A RHEL 8 system with root or sudo access
- NetworkManager installed and running (default on RHEL 8)
- Knowledge of your network interface name (e.g.,
ens3,eth0) and desired IP settings
Step 1 — Inspecting Current Network State
Before making changes, survey the existing connections and device status to understand the current configuration.
# List all NetworkManager connections (profiles)
nmcli con show
# List active connections only
nmcli con show --active
# Show the status of all network devices
nmcli device status
# Show detailed device information including IP addresses
nmcli device show
# Show detailed info for a specific device
nmcli device show ens3
# Show general NetworkManager status
nmcli general status
The connection name (under the NAME column) is used in subsequent nmcli con mod and nmcli con up commands and may differ from the device name.
Step 2 — Configuring a Static IP Address
To assign a static IP, modify the existing connection profile for your interface using nmcli con mod, then bring the connection down and back up to apply the changes.
# Set the IPv4 method to manual (static) and assign an address with prefix
nmcli con mod ens3 ipv4.method manual ipv4.addresses 192.168.1.100/24
# Set the default gateway
nmcli con mod ens3 ipv4.gateway 192.168.1.1
# Set primary and secondary DNS servers
nmcli con mod ens3 ipv4.dns "8.8.8.8 8.8.4.4"
# Disable IPv6 if not needed
nmcli con mod ens3 ipv6.method ignore
# Apply the changes by reactivating the connection
nmcli con down ens3
nmcli con up ens3
# Verify the new IP address is active
ip addr show ens3
Step 3 — Creating and Deleting Connections
nmcli con add creates a new connection profile from scratch. This is useful when adding a new interface or configuring a second IP connection on an existing device.
# Create a new static Ethernet connection profile
nmcli con add type ethernet con-name "static-ens3" ifname ens3
ipv4.method manual ipv4.addresses 10.0.0.50/24
ipv4.gateway 10.0.0.1 ipv4.dns "1.1.1.1 8.8.8.8"
# Create a DHCP connection profile
nmcli con add type ethernet con-name "dhcp-ens3" ifname ens3 ipv4.method auto
# Activate a specific connection
nmcli con up "static-ens3"
# Deactivate a connection
nmcli con down "dhcp-ens3"
# Delete a connection profile permanently
nmcli con del "dhcp-ens3"
Step 4 — Modifying Existing Connections and Reloading
Use nmcli con mod on an existing profile to update any property. After editing, reload the connection or bounce the interface to apply changes.
# Change the hostname via NetworkManager
nmcli general hostname server1.example.com
# Modify DNS on an existing connection
nmcli con mod ens3 ipv4.dns "1.1.1.1"
# Add a second IP address to the same connection
nmcli con mod ens3 +ipv4.addresses 192.168.1.101/24
# Remove a specific IP address
nmcli con mod ens3 -ipv4.addresses 192.168.1.101/24
# Reload all connection profiles from disk without restarting NetworkManager
nmcli con reload
# Restart NetworkManager if a full restart is needed (brief network interruption)
systemctl restart NetworkManager
Step 5 — Using nmtui as a Text UI Alternative
nmtui provides a curses-based text user interface for NetworkManager that is easier for users unfamiliar with nmcli syntax. It covers the most common tasks: editing connections, activating connections, and setting the system hostname.
# Launch the nmtui interface
nmtui
# nmtui presents three options:
# 1. Edit a connection — create or modify connection profiles
# 2. Activate a connection — bring connections up or down
# 3. Set system hostname — change the system hostname
# nmtui requires no special flags; navigate with arrow keys,
# Tab to move between fields, Space to toggle, Enter to confirm.
nmtui is especially useful when working on remote servers where typing long nmcli commands risks losing the SSH session before the connection change is committed.
Step 6 — Verifying Network Configuration with ip Commands
The ip command from the iproute2 package is the modern replacement for ifconfig and route. Use it to verify that NetworkManager has applied your settings correctly at the kernel level.
# Show all IP addresses and interface states
ip addr
# Show IP addresses for a specific interface
ip addr show ens3
# Show the kernel routing table
ip route
# Show the default gateway only
ip route show default
# Show link (layer-2) status and statistics
ip link show
# Bring an interface down and up using ip (temporary, not persistent)
ip link set ens3 down
ip link set ens3 up
# Flush all IP addresses from an interface (use with caution on remote sessions)
ip addr flush dev ens3
Conclusion
You can now confidently manage network interface settings on RHEL 8 using nmcli for both static and dynamic configurations, create and delete connection profiles, and verify your changes with the ip command. nmtui provides an accessible alternative when a graphical environment is unavailable and complex command syntax would be error-prone. All changes made through NetworkManager are persistent across reboots without any manual file editing.
Next steps: How to Manage System Packages with dnf on RHEL 8, How to Use journalctl for Systemd Log Analysis on RHEL 8, and How to Perform a System Security Audit with auditd on RHEL 8.