Assigning a static IP address ensures your RHEL 8 server is always reachable at a predictable address — essential for services like DNS, mail, or web hosting. On RHEL 8, NetworkManager is the default network management service and the preferred tool for making persistent network changes. Using nmcli from the command line lets you configure interfaces without a graphical session. This tutorial walks through setting a static IPv4 address on a RHEL 8 server using NetworkManager.

Prerequisites

  • A running RHEL 8 (or compatible, e.g. AlmaLinux 8 / Rocky Linux 8) server
  • Root or sudo privileges
  • The name of the network interface you want to configure (find it with ip link)
  • Your desired static IP address, subnet mask, gateway, and DNS servers
  • NetworkManager installed and running (systemctl status NetworkManager)

Step 1 — Identify Your Network Interface and Connection

Before making changes, list all active connections so you know the exact connection profile name NetworkManager is using.

nmcli con show

The output shows each connection profile alongside its UUID, type, and device. Note the NAME column — in this guide the connection is named ens3. Also run ip link to confirm the interface device name matches.

Step 2 — Set the Static IP, Gateway, and DNS

Use nmcli con mod to modify the existing connection profile. Replace the values below with those appropriate for your network.

nmcli con mod "ens3" 
  ipv4.method manual 
  ipv4.addresses 192.168.1.100/24 
  ipv4.gateway 192.168.1.1 
  ipv4.dns "8.8.8.8 1.1.1.1" 
  ipv6.method ignore

Setting ipv4.method manual disables DHCP for this profile. Setting ipv6.method ignore prevents NetworkManager from attempting automatic IPv6 configuration if you do not need it.

Step 3 — Apply the Configuration

Bring the connection down and back up so the new settings take effect. This will briefly interrupt connectivity on that interface.

nmcli con up "ens3"

If the connection was already active, NetworkManager will re-apply the profile. For remote sessions, you can chain the commands with a delay to avoid being locked out: nmcli con down "ens3" && nmcli con up "ens3".

Step 4 — Verify the New IP Address and Routing

Confirm the interface now holds the static address and that the default route is correct.

ip addr show ens3
ip route show

The ip addr output should list 192.168.1.100/24 under ens3. The ip route output should show a default route via 192.168.1.1. Test connectivity with ping -c 4 8.8.8.8 and DNS resolution with ping -c 4 google.com.

Step 5 — Use nmtui as a Menu-Driven Alternative

If you prefer a text-based menu interface, NetworkManager ships with nmtui. It provides the same capabilities as nmcli through a guided TUI.

nmtui

Select Edit a connection, choose your interface, and fill in the IPv4 configuration fields. When finished, select Activate a connection to apply the changes. This is especially useful for administrators less comfortable with command-line syntax.

Step 6 — Inspect the Persistent Configuration File

All NetworkManager connection profiles are stored as INI-style files on disk. Viewing the file confirms that your settings have been saved permanently and will survive a reboot.

cat /etc/NetworkManager/system-connections/ens3.nmconnection

You will see sections such as [ipv4] with method=manual, address1=192.168.1.100/24,192.168.1.1, and dns=8.8.8.8;1.1.1.1;. These files are owned by root and have mode 600 — do not relax those permissions. You can edit this file directly, but always run nmcli con reload afterwards to make NetworkManager pick up the changes.

Conclusion

Your RHEL 8 server now has a persistent static IP address managed by NetworkManager. The configuration survives reboots and is stored in /etc/NetworkManager/system-connections/. Using nmcli keeps changes consistent and auditable compared to editing legacy ifcfg files by hand.

Next steps: How to Set Up a DNS Server with BIND9 on RHEL 8, How to Install and Configure Postfix Mail Server on RHEL 8, and How to Configure firewalld Zones on RHEL 8.