// learn Β· networking Β· rhcsa Β· 10 min

Networking basics.

On a modern RHEL system, NetworkManager owns the network and nmcli is how you drive it. Watch an interface go from no address to a fully configured static IP β€” connection profile, gateway, DNS β€” then verify it end to end.

Linux networking basics animated tutorial. Interfaces and IP addresses, NetworkManager connections vs devices, configuring a static IP with nmcli, the default gateway and DNS, connection profiles, and verification with ip/ping/nmcli. RHCSA EX200 ready.
// networking basics

On RHEL, NetworkManager owns the network and nmcli drives it. Watch an interface go from no address to a fully configured, persistent static IP β€” then verify the whole chain.

// before you start
you should know
  • Β·Know what an IP address and CIDR (/24) mean
  • Β·Helpful: the NAT-and-routing lesson (gateways, routes)
  • Β·Comfortable running commands as root / with sudo
by the end you'll

Configure a static IP with nmcli, understand connections vs devices, set the gateway and DNS, and troubleshoot connectivity layer by layer.

pace: 10 minutes

interface config β€” step 1 / 6 Β· interfaces
πŸ–§ interface● down
deviceens160
MAC00:0c:29:ab:cd:ef

Interfaces and addresses

A network interface is the kernel's handle on a NIC β€” named like ens160, eth0, or wlan0 (lo is the loopback). `ip addr` shows each interface, its state (UP/DOWN), and its IP address with CIDR prefix (e.g. 192.168.1.50/24 β€” the /24 means the first 24 bits are the network). A fresh interface may be UP at the link layer but have no IP yet.

$ip addr
$ip -br addr
$ip link
// key insight

The mental model: edit the profile, then activate it. `nmcli con mod` writes settings to disk; `nmcli con up` applies them. Forgetting the second step is the #1 "I changed it but nothing happened" confusion. And never hand-edit /etc/resolv.conf β€” NetworkManager owns it.

// exam-ready Β· nmcli & ip
$nmcli dev status
$nmcli con show
$nmcli con show ens160
$nmcli con add type ethernet con-name ens160 ifname ens160
$nmcli con mod ens160 ipv4.addresses 192.168.1.50/24
$nmcli con mod ens160 ipv4.gateway 192.168.1.1
$nmcli con mod ens160 ipv4.dns 1.1.1.1
$nmcli con mod ens160 ipv4.method manual
$nmcli con up / down ens160
$nmcli con reload
$ip addr / ip -br a
$ip route
$ping -c3 HOST
$ss -tlnp
$hostnamectl set-hostname X
$/etc/NetworkManager/system-connections/
// check yourself
4 quick questions
Q1

In NetworkManager terms, what's the difference between a 'device' and a 'connection'?

Q2

You ran `nmcli con mod ens160 ipv4.addresses 192.168.1.50/24 ipv4.method manual` but the interface still has its old DHCP address. Why?

Q3

`ping 1.1.1.1` works but `ping google.com` fails. What's broken?

Q4

Where should you set the DNS servers on a NetworkManager system, and what should you NOT do?

These aren't graded β€” they're just for active recall, which is what actually makes the lesson stick.

🌐
// pick the right /prefix

subnet calculator

Before you assign 192.168.1.50/24, know exactly which addresses are on-subnet, where the gateway and broadcast sit, and how many hosts fit.

open β†’

Read this lesson as text6 chapters Β· quiz answers

  1. 01Interfaces and addresses

    A network interface is the kernel's handle on a NIC β€” named like ens160, eth0, or wlan0 (lo is the loopback). ip addr shows each interface, its state (UP/DOWN), and its IP address with CIDR prefix (e.g. 192.168.1.50/24 β€” the /24 means the first 24 bits are the network). A fresh interface may be UP at the link layer but have no IP yet.

    • $ ip addr β€” all interfaces + addresses
    • $ ip -br addr β€” one-line-per-interface summary
    • $ ip link β€” link-layer state (UP/DOWN)
  2. 02NetworkManager β€” connections vs devices

    On RHEL, NetworkManager owns the network and nmcli is the CLI. Two concepts: a DEVICE is the physical interface (ens160); a CONNECTION is a named, saved profile of settings (IP, gateway, DNS) that you activate ONTO a device. One device can have several connection profiles β€” you just activate the one you want. nmcli con show lists profiles; nmcli dev status lists devices.

    • $ nmcli con show β€” list connection profiles
    • $ nmcli dev status β€” list devices + their state
    • $ nmcli β€” everything at a glance
  3. 03Set a static IP

    To pin a static address, modify the connection profile and switch ipv4.method from auto to manual. nmcli con mod ens160 ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.dns 1.1.1.1 ipv4.method manual. Nothing changes on the live interface yet β€” you've only edited the saved profile on disk.

    • $ nmcli con mod ens160 ipv4.addresses 192.168.1.50/24 β€” set the address
    • $ nmcli con mod ens160 ipv4.gateway 192.168.1.1 β€” set the gateway
    • $ nmcli con mod ens160 ipv4.dns 1.1.1.1 ipv4.method manual β€” DNS + switch to manual
  4. 04Activate it

    Edits to a profile take effect when you (re)activate it: nmcli con up ens160. The interface picks up the new address immediately. The profile is stored on disk under /etc/NetworkManager/system-connections/ (a keyfile), so it survives reboots β€” no editing ifcfg files by hand anymore.

    • $ nmcli con up ens160 β€” (re)activate the profile
    • $ nmcli con reload β€” reread profiles from disk
    • $ /etc/NetworkManager/system-connections/ β€” where profiles live
  5. 05Gateway and DNS β€” leaving the subnet

    Your IP/24 lets you reach hosts on the SAME subnet directly. For anything else, packets go to the default gateway (192.168.1.1 here) β€” that's the router from the NAT/routing lesson. DNS servers (set via ipv4.dns) turn names into IPs. NetworkManager writes the resolver into /etc/resolv.conf for you; don't hand-edit it β€” set ipv4.dns on the connection instead.

    • $ ip route β€” default via 192.168.1.1
    • $ cat /etc/resolv.conf β€” resolver (managed by NM)
    • $ nmcli con mod ens160 ipv4.dns "1.1.1.1 8.8.8.8" β€” two DNS servers
  6. 06Verify and troubleshoot

    Top-down: is the interface UP with the right IP (ip a)? Is there a default route (ip route)? Can you reach the gateway (ping 192.168.1.1)? The internet by IP (ping 1.1.1.1)? By name (ping google.com β€” if IP works but name doesn't, it's DNS)? nmcli dev status confirms the connection is active. This layer-by-layer check finds where the chain breaks.

    • $ ip a / ip route β€” address + routing
    • $ ping -c3 192.168.1.1 β€” reach the gateway
    • $ ping -c3 1.1.1.1 β€” internet by IP
    • $ ping -c3 google.com β€” DNS works? (name β†’ IP)

Quiz β€” answers

In NetworkManager terms, what's the difference between a 'device' and a 'connection'?
β†’A device is the physical interface (ens160); a connection is a named, saved profile of settings (IP, gateway, DNS) that you activate onto a device.One device can have multiple connection profiles (e.g. home vs office); you activate the one you want with nmcli con up. nmcli dev status lists devices, nmcli con show lists profiles.
You ran nmcli con mod ens160 ipv4.addresses 192.168.1.50/24 ipv4.method manual but the interface still has its old DHCP address. Why?
β†’Modifying a profile only edits the saved settings β€” you must (re)activate it with nmcli con up ens160 for the change to take effect on the live interface.con mod writes to the profile on disk; it doesn't touch the running interface. nmcli con up ens160 re-applies the profile and the new address takes effect immediately (and persists across reboots).
ping 1.1.1.1 works but ping google.com fails. What's broken?
→DNS resolution — you can reach the internet by IP, but name→IP lookup is failing. Check ipv4.dns / /etc/resolv.conf.Reaching an IP proves routing and connectivity are fine. Failing on a name means the resolver can't turn the name into an IP — a DNS problem. Fix the DNS server (ipv4.dns on the connection).
Where should you set the DNS servers on a NetworkManager system, and what should you NOT do?
β†’Set ipv4.dns on the connection profile (nmcli con mod …); don't hand-edit /etc/resolv.conf, because NetworkManager regenerates it and your changes get wiped.NetworkManager manages /etc/resolv.conf. Hand-edits get overwritten on the next connection change. Set ipv4.dns (and ipv4.ignore-auto-dns yes if you don't want DHCP-provided ones) on the profile instead.
// more in networking

keep going β€” these pair well with what you just learned.

see all networking β†’

See also

NAT and routingall lessons