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.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.
- Β·Know what an IP address and CIDR (/24) mean
- Β·Helpful: the NAT-and-routing lesson (gateways, routes)
- Β·Comfortable running commands as root / with sudo
Configure a static IP with nmcli, understand connections vs devices, set the gateway and DNS, and troubleshoot connectivity layer by layer.
pace: 10 minutes
deviceens160MAC00:0c:29:ab:cd:efInterfaces 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 linkThe 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.
$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/In NetworkManager terms, what's the difference between a 'device' and a 'connection'?
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?
`ping 1.1.1.1` works but `ping google.com` fails. What's broken?
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.
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.
Read this lesson as text6 chapters Β· quiz answers
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 addrshows 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)
02NetworkManager β connections vs devices
On RHEL, NetworkManager owns the network and
nmcliis 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 showlists profiles;nmcli dev statuslists devices.$ nmcli con showβ list connection profiles$ nmcli dev statusβ list devices + their state$ nmcliβ everything at a glance
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
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
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
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 statusconfirms 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 statuslists devices,nmcli con showlists profiles. - You ran
nmcli con mod ens160 ipv4.addresses 192.168.1.50/24 ipv4.method manualbut 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 ens160for the change to take effect on the live interface.con modwrites to the profile on disk; it doesn't touch the running interface.nmcli con up ens160re-applies the profile and the new address takes effect immediately (and persists across reboots). ping 1.1.1.1works butping google.comfails. 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.
keep going β these pair well with what you just learned.
What happens when you type a URL?
The most-asked interview question, animated. Five chapters: DNS β TCP β TLS β HTTP β Render. Step through each at your own pace.
OSI / TCP-IP layers
A packet wrapped layer-by-layer, then unwrapped on the other side. Watch headers stack and peel off β OSI 7 and TCP/IP 4 side by side.
DNS deep dive
Beyond the basics: recursive vs iterative, cache layers, TTLs, glue records, and what `dig +trace` actually shows.