Domain 8NetworkingCORE

Managing Networking

Comprehensive guide to RHEL network management, covering IP subnets, NetworkManager configuration with nmcli/nmtui, persistent DNS/hostname configuration, and network troubleshooting.

Domain: Manage basic networking•Updated: 2026-08-30
#Networking#NetworkManager#nmcli#nmtui#IP#DNS#RHCSA#RHEL

Managing Networking

Theory Questions

1. Determine which IP addresses belong to the same network given a subnet mask.

  • Command(s):
ipcalc 192.168.4.210/24
  • Why: The subnet mask (or CIDR prefix) divides an IP address into a network portion and a host portion. Performing a bitwise AND operation between the IP address and the subnet mask yields the network address. Hosts sharing the identical network address belong to the same local broadcast domain and can communicate directly without a router.
  • Gotchas: Assuming hosts on different subnets (e.g., 192.168.4.10/24 and 192.168.5.10/24) can talk without a default gateway configured.
  • Verify:
ipcalc 192.168.4.210/24 | grep Network

2. Identify which IP addresses are and are not private.

  • Command(s):
ip addr show
  • Why: RFC 1918 designates three IPv4 address ranges exclusively for private network usage:

  • 10.0.0.0/8 (10.0.0.0 – 10.255.255.255)

  • 172.16.0.0/12 (172.16.0.0 – 172.31.255.255)

  • 192.168.0.0/16 (192.168.0.0 – 192.168.255.255) Any address outside these ranges (or CGNAT 100.64.0.0/10 / loopback 127.0.0.0/8) is classified as a public internet-routable IP address.

  • Gotchas: Misidentifying 172.32.0.1 or 172.15.0.1 as private IPs. Only 172.16.0.0 through 172.31.255.255 are private.

  • Verify:

ip route get 8.8.8.8

3. Identify valid network interface names on a RHEL 9 system.

  • Command(s):
ip link show
  • Why: RHEL 9 uses Predictable Network Interface Naming conventions based on hardware location, firmware, and PCI bus indices:

  • eno1: Onboard Ethernet device 1.

  • enp2s0: Ethernet on PCI bus 2, slot 0.

  • wlp3s0: Wireless interface on PCI bus 3, slot 0.

  • eth0: Legacy kernel default interface name.

  • Gotchas: Hardcoding eth0 in configuration scripts or commands when the virtual machine hardware enumerates the interface as enp1s0 or veth*.

  • Verify:

ls /sys/class/net

4. Display information about a network interface and its IP configuration.

  • Command(s):
ip addr show enp1s0
# OR
nmcli device show enp1s0
  • Why: ip addr show displays hardware MAC addresses, assigned IPv4/IPv6 subnets, MTU, and link flags. nmcli device show provides detailed NetworkManager metadata including DNS servers and domain search suffixes.
  • Gotchas: Using deprecated utilities like ifconfig, which may not be installed by default on minimal RHEL installations.
  • Verify:
ip -4 addr show enp1s0

5. Evaluate statements about NetworkManager, identifying true and false claims.

  • Command(s):
systemctl status NetworkManager
  • Statements Evaluation:

  • True: NetworkManager dynamically controls network interfaces and stores persistent profiles in keyfiles under /etc/NetworkManager/system-connections/.

  • True: Changes applied via nmcli connection modify update keyfile configurations on disk but require nmcli connection up to activate runtime changes.

  • False: NetworkManager configurations should be managed by editing /etc/sysconfig/network-scripts/ifcfg-* files in RHEL 9. (Correction: Legacy ifcfg scripts are deprecated in RHEL 9 in favor of INI-format keyfiles.)

  • Why: Understanding NetworkManager’s modern architecture ensures compliance with current Enterprise Linux standards.

  • Gotchas: Attempting to install or use legacy network-scripts packages on RHEL 9/10.

  • Verify:

nmcli --version

6. Find man page examples for nmcli usage.

  • Command(s):
man nmcli-examples
  • Why: Red Hat provides a dedicated man page (nmcli-examples) containing syntactically correct examples for setting static IPs, creating team/bond interfaces, adding VLANs, and managing DNS.
  • Gotchas: Struggling to memorize complex nmcli syntax during the exam instead of using man nmcli-examples.
  • Verify:
man -k nmcli

7. Identify the text-based user interface for network connection properties.

  • Command(s):
nmtui
  • Why: nmtui (NetworkManager Text User Interface) is a curses-based terminal application that allows administrators to interactively add, modify, or activate network connections and hostnames.
  • Gotchas: Exiting nmtui without navigating to “Activate a connection” to reload the modified profile.
  • Verify:
nmtui-edit

8. Set a fixed IP address to a connection using nmcli.

  • Command(s):
nmcli connection modify "eth0" ipv4.addresses 192.168.4.210/24 ipv4.method manual
nmcli connection up "eth0"
  • Why: ipv4.addresses assigns the static IP/prefix, and ipv4.method manual disables dynamic DHCP assignment. nmcli connection up applies the modified configuration into runtime memory.
  • Gotchas: Forgetting to set ipv4.method manual when assigning a static IP; NetworkManager will continue attempting to request an IP via DHCP alongside the static address.
  • Verify:
ip addr show eth0

  • Command(s):
# Recommended:
nmcli connection modify "eth0" ipv4.dns "8.8.8.8 1.1.1.1"
nmcli connection up "eth0"
  • Why:

  • Recommended: Setting DNS parameters inside NetworkManager connection profiles via nmcli or nmtui. NetworkManager automatically updates /etc/resolv.conf persistently.

  • Non-Recommended: Editing /etc/resolv.conf manually.

  • Gotchas: Manually editing /etc/resolv.conf directly. NetworkManager will overwrite manual changes whenever the network interface restarts or dynamic leases refresh.

  • Verify:

cat /etc/resolv.conf

10. Set the hostname in the correct configuration file.

  • Command(s):
hostnamectl set-hostname server1.example.com
  • Why: hostnamectl set-hostname updates the static hostname in /etc/hostname and notifies systemd-hostnamed to update runtime kernel structures immediately.
  • Gotchas: Editing /etc/hosts expecting it to change the system hostname. /etc/hosts provides local IP resolution, whereas /etc/hostname defines system identity.
  • Verify:
hostnamectl status

11. Calculate the network address from a given IP and CIDR prefix.

  • Command(s):
ipcalc 192.168.4.210/24 | grep Network
  • Why: ipcalc performs binary mask operations to output the base network ID, broadcast address, and host range.
  • Gotchas: Miscalculating non-standard CIDR boundaries (e.g., /27 or /22) during manual bitwise math.
  • Verify:
ipcalc 192.168.4.210/24

  • Command(s):
ip link show
# OR
nmcli device status
  • Why: ip link show displays Layer 2 link states (e.g., UP, LOWER_UP, MAC address, MTU) without querying or listing Layer 3 IPv4/IPv6 addresses.
  • Gotchas: Confusing Layer 2 link availability (ip link) with Layer 3 IP connectivity (ip addr).
  • Verify:
ip link show dev enp1s0

13. Diagnose why manually edited /etc/resolv.conf changes disappear after restart.

  • Command(s):
cat /etc/resolv.conf | grep "Generated by"
  • Why: /etc/resolv.conf is dynamically generated and managed by NetworkManager. Manual edits are discarded whenever NetworkManager re-evaluates active interface profiles or receives new DHCP leases.
  • Gotchas: Setting rc-manager=unmanaged in NetworkManager to stop edits, which breaks automated DNS configuration for standard profiles.
  • Verify:
nmcli connection show "eth0" | grep ipv4.dns

14. Identify the file containing the hostname in RHEL 9.

  • Path / Command:
/etc/hostname
  • Why: Systemd reads /etc/hostname during early system boot to initialize the kernel hostname (sysctl kernel.hostname).
  • Gotchas: Adding spaces or trailing invalid characters inside /etc/hostname.
  • Verify:
cat /etc/hostname

15. Set the hostname using a simple command.

  • Command(s):
hostnamectl set-hostname server1.example.com
  • Why: Provides a single-command interface to update static, transient, and pretty hostnames persistently across reboots.
  • Gotchas: Forgetting to log out and log back in (or restart the shell) to reflect the updated prompt hostname.
  • Verify:
hostname

16. Locate where NetworkManager stores its generated configuration.

  • Path / Command:
/etc/NetworkManager/system-connections/
  • Why: In RHEL 9, connection profiles are stored as INI-format keyfiles in /etc/NetworkManager/system-connections/<connection-name>.nmconnection with restricted permissions (0600).
  • Gotchas: Manually creating files in /etc/NetworkManager/system-connections/ without running nmcli connection reload and enforcing 0600 permissions.
  • Verify:
ls -la /etc/NetworkManager/system-connections/

17. Enable hostname resolution for a specific IP address.

  • Command(s): Add a mapping entry to /etc/hosts:
echo "192.168.4.220 server2.example.com server2" >> /etc/hosts
  • Why: /etc/hosts provides local static IP-to-hostname name resolution parsed prior to DNS server queries according to /etc/nsswitch.conf.
  • Gotchas: Placing hostname before the IP address in /etc/hosts. The format must strictly be <IP_Address> <FQDN> [Alias...].
  • Verify:
getent hosts server2.example.com

18. Determine whether non-administrator users can change NetworkManager connections.

  • Command(s):
nmcli connection modify "eth0" ipv4.dns "8.8.8.8"
  • Why: By default, Polkit policies restrict modification of system-wide NetworkManager connection profiles to administrative users (root or users with sudo privileges). Standard unprivileged users are denied access unless explicit Polkit rules are configured.
  • Gotchas: Assuming standard users can modify network settings via nmcli without administrative privileges.
  • Verify:
polkit-action --action-id org.freedesktop.NetworkManager.network-control

19. Verify the current status of the NetworkManager service.

  • Command(s):
systemctl status NetworkManager
  • Why: Displays systemd execution state, process ID, memory footprint, and recent journal log entries for NetworkManager.
  • Gotchas: Checking systemctl status network (the legacy network service does not exist in RHEL 9).
  • Verify:
systemctl is-active NetworkManager

20. Change the current IP address and default gateway on a network connection.

  • Command(s):
nmcli connection modify "eth0" ipv4.addresses 192.168.4.210/24 ipv4.gateway 192.168.4.1 ipv4.method manual
nmcli connection up "eth0"
  • Why: ipv4.addresses updates static host addressing, ipv4.gateway defines default routing table egress paths, and nmcli connection up applies the keyfile changes live.
  • Gotchas: Changing IP settings over SSH without combining modify and up commands properly, which can sever the active SSH session before execution completes.
  • Verify:
ip addr show eth0
ip route show

Lab Tasks

Networking Practice

Task 1: Set up server1.example.com and server2.example.com with proper FQDNs.

  • Command(s):
# Execute on server1:
hostnamectl set-hostname server1.example.com

# Execute on server2:
hostnamectl set-hostname server2.example.com

# Update /etc/hosts on both nodes for local resolution:
cat << 'EOF' >> /etc/hosts
192.168.4.210 server1.example.com server1
192.168.4.220 server2.example.com server2
EOF
  • Why:

  • hostnamectl set-hostname: Sets persistent FQDNs in /etc/hostname.

  • /etc/hosts: Ensures node names resolve reliably without external DNS dependencies.

  • Gotchas: Setting short names (e.g., server1) instead of full FQDNs (server1.example.com) when explicitly requested.

  • Verify:

hostnamectl status
ping -c 2 server2.example.com

Task 2: Configure primary network cards for DHCP and static IP assignment using nmtui or nmcli.

  • Command(s):
# Option A: Interactive configuration via nmtui
nmtui

# Option B: CLI configuration via nmcli (Server 1 - Dual/Static IP setup):
nmcli connection modify "eth0" ipv4.method manual ipv4.addresses 192.168.4.210/24 ipv4.gateway 192.168.4.1 ipv4.dns "192.168.4.1"
nmcli connection up "eth0"

# CLI configuration (Server 2 - Static IP setup):
nmcli connection modify "eth0" ipv4.method manual ipv4.addresses 192.168.4.220/24 ipv4.gateway 192.168.4.1 ipv4.dns "192.168.4.1"
nmcli connection up "eth0"
  • Why:

  • ipv4.method manual: Ensures static IP bindings persist across system reboots.

  • nmcli connection up: Commits modifications to runtime interface sockets.

  • Gotchas: Forgetting to activate the connection after editing inside nmtui or running nmcli modify.

  • Verify:

ip addr show eth0

Task 3: Verify bidirectional ping connectivity between server1 and server2.

  • Command(s):
# Test from server1 to server2:
ping -c 4 192.168.4.220
ping -c 4 server2.example.com

# Test from server2 to server1:
ping -c 4 192.168.4.210
ping -c 4 server1.example.com
  • Why: Validates complete Layer 3 IP routing and local hostname resolution between both endpoints.
  • Gotchas: Local firewall rules blocking ICMP echo requests; if ping fails, check firewall-cmd.
  • Verify:
ping -c 2 server2.example.com

(Output should show 0% packet loss)


Task 4: Configure the local DHCP server to provide default router and DNS servers for Internet access.

  • Command(s):
# Install DHCP server package (if configuring DHCP service node):
dnf install -y dhcp-server

# Configure /etc/dhcp/dhcpd.conf:
cat << 'EOF' > /etc/dhcp/dhcpd.conf
option domain-name "example.com";
option domain-name-servers 8.8.8.8, 1.1.1.1;

default-lease-time 600;
max-lease-time 7200;
authoritative;

subnet 192.168.4.0 netmask 255.255.255.0 {
  range 192.168.4.50 192.168.4.100;
  option routers 192.168.4.1;
}
EOF

# Enable and start service:
systemctl enable --now dhcpd

# Open firewall port:
firewall-cmd --permanent --add-service=dhcp
firewall-cmd --reload
  • Why:

  • option routers: Delivers default gateway addresses to DHCP clients.

  • option domain-name-servers: Configures client DNS resolution endpoints dynamically upon lease acquisition.

  • systemctl enable --now dhcpd: Ensures DHCP service starts automatically on system boot.

  • Gotchas: Syntax errors in /etc/dhcp/dhcpd.conf (such as missing trailing semicolons ;) will prevent dhcpd from starting.

  • Verify & Reboot Persistence Test:

# Check DHCP server execution state:
systemctl status dhcpd

# Reboot system to confirm configuration persistence:
reboot

# Post-reboot check:
systemctl is-active dhcpd
nmcli connection show "eth0" | grep -E "IP4.ADDRESS|IP4.GATEWAY|IP4.DNS"

(Confirms NetworkManager settings and services remain active and persistent across system reboots)