17.1 Configure IPv4 and IPv6 Addresses
Key Takeaways
- On RHEL 10, configure persistent interface addressing primarily with nmcli (or nmtui) against NetworkManager connection profiles—not by hand-editing temporary runtime-only settings.
- Use nmcli connection modify (or add) for IPv4/IPv6 method, addresses, gateway, and DNS; apply with nmcli connection up; verify with ip addr, ip route, and nmcli device/connection show.
- Static IPv4 uses ipv4.method manual with ipv4.addresses and usually ipv4.gateway; IPv6 uses ipv6.method manual or auto/disabled as the task requires.
- ip addr and ip link show live state; they do not by themselves replace a saved NetworkManager profile that must survive reboot.
- EX200 success is correct addressing after reboot: connection enabled, profile applied, interface up, and routes/DNS matching the task.
17.1 Configure IPv4 and IPv6 Addresses
Quick Answer: Prefer NetworkManager with
nmcli. Set addresses on a connection profile (nmcli connection modifyoradd), thennmcli connection up. Verify withip addr,ip route, andnmcli -f all connection show NAME. Runtime-onlyip addr addwithout a saved profile usually fails after reboot.
Official skill and exam framing
Under Manage basic networking, Red Hat expects you to configure IPv4 and IPv6 addresses. Lab wording looks like:
- “Configure the primary interface with static IPv4
172.25.250.11/24and gateway172.25.250.254.” - “Ensure the host has a static IPv6 address
2001:db8:0:1::11/64.” - “Use NetworkManager so the configuration persists across reboot.”
You are graded on end state after reboot: correct address on the right interface (or connection), gateway if required, and a profile NetworkManager will reapply. Memorize tools, not just temporary CLI tricks.
NetworkManager is the RHEL path
On modern RHEL (including RHEL 10), NetworkManager owns interface configuration. Connection profiles store method, addresses, routes, and DNS. Devices (NICs) are bound to profiles.
| Concept | Meaning |
|---|---|
| Device | Hardware or virtual NIC (eth0, ens192, enp1s0) |
| Connection | Named profile NetworkManager applies to a device |
| Active connection | Profile currently applied |
systemctl is-active NetworkManager
nmcli general status
nmcli device status
nmcli connection show
nmcli connection show --active
If NetworkManager is stopped or disabled, fix that first (see Section 17.3). Do not fight NetworkManager by only editing legacy ifcfg files unless a task forces an unusual path—nmcli is the reliable EX200 skill.
Inspect before you change
ip link show
ip -br addr
ip addr show
ip route
nmcli device show
nmcli -f NAME,UUID,TYPE,DEVICE,FILENAME connection show
Identify:
- Which device is the exam interface (often the only non-
loNIC, or the one already on the lab network). - Which connection name is bound to it (may match the device name or a friendly name like
Wired connection 1). - Whether addressing is currently auto (DHCP) or manual.
nmcli device show ens192 | egrep 'GENERAL|IP4|IP6|CONNECTION'
nmcli connection show ens192
# or:
nmcli connection show "Wired connection 1"
Tip: Quote connection names that contain spaces.
Static IPv4 with nmcli connection modify
Assume device ens192 already has connection profile ens192:
sudo nmcli connection modify ens192 \
ipv4.method manual \
ipv4.addresses 172.25.250.11/24 \
ipv4.gateway 172.25.250.254 \
ipv4.dns 172.25.250.254 \
connection.autoconnect yes
sudo nmcli connection up ens192
| Property | Role |
|---|---|
ipv4.method manual | Static IPv4 (not DHCP) |
ipv4.addresses | Address/prefix (a.b.c.d/nn) |
ipv4.gateway | Default gateway |
ipv4.dns | DNS servers (space-separated if multiple) |
ipv4.dns-search | Search domains when required |
connection.autoconnect yes | Activate at boot when device is available |
Multiple addresses on one connection:
sudo nmcli connection modify ens192 \
ipv4.addresses "172.25.250.11/24,172.25.250.12/24"
Or append:
sudo nmcli connection modify ens192 +ipv4.addresses 172.25.250.12/24
Create a new connection profile
When you need a clean profile or the task says “create a connection”:
sudo nmcli connection add type ethernet con-name lab ifname ens192 \
ipv4.method manual \
ipv4.addresses 172.25.250.11/24 \
ipv4.gateway 172.25.250.254 \
ipv6.method ignore
sudo nmcli connection up lab
ifname binds the profile to a device. Bring the intended profile up so it becomes active (only one ethernet profile typically active per device).
DHCP / automatic IPv4
sudo nmcli connection modify ens192 ipv4.method auto
sudo nmcli connection up ens192
auto is NetworkManager’s DHCP (and related automatic) method for IPv4. Use when the task requires dynamic addressing rather than a fixed IP.
IPv6 configuration
| Method | Meaning |
|---|---|
ipv6.method auto | Automatic configuration (SLAAC/DHCPv6 as applicable) |
ipv6.method manual | Static IPv6 |
ipv6.method disabled / ignore | Do not configure IPv6 on this connection (wording varies by NM version; use what nmcli accepts on the exam host) |
Static IPv6 example:
sudo nmcli connection modify ens192 \
ipv6.method manual \
ipv6.addresses 2001:db8:0:1::11/64 \
ipv6.gateway 2001:db8:0:1::1
sudo nmcli connection up ens192
Combined dual-stack (common exam pattern):
sudo nmcli connection modify ens192 \
ipv4.method manual \
ipv4.addresses 172.25.250.11/24 \
ipv4.gateway 172.25.250.254 \
ipv6.method manual \
ipv6.addresses 2001:db8:0:1::11/64 \
ipv6.gateway 2001:db8:0:1::1 \
connection.autoconnect yes
sudo nmcli connection up ens192
If the task only mentions IPv4, leave IPv6 as-is unless it conflicts; if it requires IPv6 static, set ipv6.method manual explicitly.
Apply changes: connection up vs device reapply
nmcli connection modify updates the stored profile. Runtime may lag until you re-activate:
sudo nmcli connection up ens192
# equivalent idea:
sudo nmcli device reapply ens192 # when supported and profile already active
Prefer connection up after address changes so you know the profile reapplied cleanly. Watch for errors (wrong syntax, address conflict, missing device).
Verify with ip and nmcli
ip -br addr show ens192
ip addr show ens192
ip -4 route
ip -6 route
ping -c 2 172.25.250.254
ping -c 2 -6 2001:db8:0:1::1
nmcli -f ipv4.method,ipv4.addresses,ipv4.gateway,ipv6.method,ipv6.addresses connection show ens192
nmcli device show ens192 | egrep 'IP4.ADDRESS|IP4.GATEWAY|IP6.ADDRESS'
Confirm prefix length (/24 not forgotten), gateway on the correct subnet, and that the address appears on the correct device.
Runtime ip commands vs persistence
# Temporary only — useful for diagnosis, not full EX200 persistence:
sudo ip addr add 172.25.250.11/24 dev ens192
sudo ip route add default via 172.25.250.254
These change live kernel state. Without a matching NetworkManager (or other persistent) configuration, they disappear on reboot or when NM reapplies a different profile. Use ip to verify and to understand state; use nmcli to configure for the exam.
ip link set ens192 up
ip link set ens192 down # careful: may cut remote access
nmtui (optional UI)
sudo nmtui
Text UI: Edit a connection → IPv4/IPv6 Configuration → Manual → addresses/gateway/DNS → OK → Activate a connection. Same persistence model as nmcli. Use if you prefer menus under time pressure, but still verify with ip addr.
Hostname is not an IP address
Setting the system hostname (hostnamectl) does not assign IPv4/IPv6. Addressing is this section; name resolution is Section 17.2. Tasks often require both—do not stop after only setting a pretty hostname.
Exam workflows
Workflow A — Static IPv4 on existing profile
nmcli device status
nmcli connection show
sudo nmcli connection modify ens192 \
ipv4.method manual \
ipv4.addresses 172.25.250.11/24 \
ipv4.gateway 172.25.250.254 \
connection.autoconnect yes
sudo nmcli connection up ens192
ip -br addr show ens192
ip route | grep default
Workflow B — New named connection
sudo nmcli connection add type ethernet con-name static-lab ifname ens192 \
ipv4.method manual ipv4.addresses 172.25.250.11/24 \
ipv4.gateway 172.25.250.254 ipv6.method ignore
sudo nmcli connection up static-lab
nmcli connection show --active
Workflow C — Static IPv6 only addition
sudo nmcli connection modify ens192 \
ipv6.method manual \
ipv6.addresses 2001:db8:0:1::11/64 \
ipv6.gateway 2001:db8:0:1::1
sudo nmcli connection up ens192
ip -6 addr show ens192
Workflow D — Prove persistence mindset
nmcli -g connection.autoconnect connection show ens192
nmcli -g ipv4.method,ipv4.addresses connection show ens192
# After any allowed reboot in practice:
ip -br addr; ip route
Common traps
ip addr addonly — works now, gone after reboot or NM reapply.- Forgetting
ipv4.method manual— leftoverautomay fight or ignore your static intent. - Missing prefix —
172.25.250.11without/24is incomplete for NM addressing. - Wrong connection name — modifying a profile not bound to the active device.
- modify without
connection up— disk profile correct, live address stale. - Gateway on wrong subnet — no default route reachability.
- Cutting your only remote IP mid-change without console access—change carefully on SSH sessions.
- Disabling IPv6 when the task requires an IPv6 address.
- Assuming hostname equals DNS or IP configuration.
- Leaving
autoconnect noso the profile does not return after reboot.
Relationship to other sections
| Skill | Section |
|---|---|
| IPv4/IPv6 addresses | 17.1 (this) |
| Hostname, hosts, resolver | 17.2 |
| NetworkManager at boot | 17.3 |
| firewalld restrict access | 17.4 |
Section checkpoint
You should list devices and connections, set static or automatic IPv4 and IPv6 with nmcli connection modify/add, reapply with nmcli connection up, verify with ip addr and ip route, keep connection.autoconnect yes when the address must return after boot, and treat NetworkManager profiles—not one-off ip commands—as the EX200 source of truth for addressing on RHEL 10.
Which approach best configures a persistent static IPv4 address on RHEL 10 for EX200?
You ran nmcli connection modify ens192 ipv4.addresses 10.0.0.5/24 but ip addr still shows the old DHCP address. What is the most likely missing step?
Which nmcli property pair is appropriate for a static IPv6 host address on a connection?
What is the main exam risk of configuring an address only with ip addr add and ip route add?