Red Hat System Administration I · RH124

Chapter 17

Introduction to Networking
IPv4 basics · NetworkManager · nmcli & nmtui · Name resolution
CIS126RH — Mesa Community College

Chapter Objective

Describe basic IPv4 networking concepts, view current network configuration, and configure network connections using NetworkManager's command-line and text-UI tools.

Key Commands

  • ip addr
  • nmcli
  • nmtui
  • hostnamectl
  • ping

IPv4 Addressing Basics

Every device on an IPv4 network needs an IP address — a 32-bit number, written as four decimal numbers separated by dots (e.g. 192.168.1.50) — along with a subnet mask defining which portion of the address identifies the network versus the specific host.

TermMeaning
IP addressA unique numeric identifier for a device on a network
Subnet maskDefines which bits of an address represent the network vs. the host
CIDR notationShorthand for a subnet mask, e.g. /24 for 255.255.255.0
Default gatewayThe router traffic is sent to when the destination isn't on the local network
DNS serverTranslates hostnames like example.com into IP addresses
Why It Matters — Nearly every networking problem eventually comes down to one of these five things being missing or wrong — knowing them cold makes troubleshooting systematic instead of guesswork.

NetworkManager

NetworkManager is the service that manages network connections on RHEL — detecting interfaces, applying configuration, and keeping connections up. It's controlled through several front ends that all manipulate the same underlying configuration.

ToolInterface
nmcliCommand-line, scriptable
nmtuiText-based menu UI, good for interactive use over SSH
GNOME SettingsGraphical, for desktop systems
Tip — Same Backend, Different Doors — A change made in nmtui is immediately visible to nmcli and vice versa — they're just different ways of talking to the same NetworkManager service.

Viewing Current Network Configuration

# Show all network interfaces and their IP addresses
ip addr show

# Shortened form of the same command
ip a

# Show just one interface
ip addr show eth0

# Show the routing table, including the default gateway
ip route show

# List NetworkManager connection profiles
nmcli connection show

# Show general device status (connected/disconnected, connection name)
nmcli device status
Note — Interface vs. Connection — A device (like eth0) is the physical or virtual network interface. A connection is the saved configuration profile NetworkManager applies to a device. One device can have multiple connection profiles, even though only one is typically active at a time.

Configuring with nmcli

# Configure a static IPv4 address, prefix, and gateway on a connection
nmcli connection modify eth0 ipv4.addresses 192.168.1.50/24
nmcli connection modify eth0 ipv4.gateway 192.168.1.1
nmcli connection modify eth0 ipv4.dns 192.168.1.1
nmcli connection modify eth0 ipv4.method manual

# Switch back to DHCP instead of a static address
nmcli connection modify eth0 ipv4.method auto

# Apply the changes by bringing the connection down and back up
nmcli connection down eth0
nmcli connection up eth0
Warning — Changes Don't Apply Until You Reactivatenmcli connection modify only updates the saved profile — it does not immediately reconfigure the live connection. You need to bring the connection down and back up (or reboot) before the change actually takes effect.

Configuring with nmtui

# Launch the text-based network configuration menu
nmtui

nmtui presents a menu-driven interface for editing connections, activating/deactivating them, and changing the hostname — useful when you'd rather navigate with arrow keys than remember exact nmcli syntax, especially during an interactive SSH session.

Tip — Know Bothnmtui is friendlier for one-off interactive changes; nmcli is what you'll use in scripts and automation. Being comfortable with both covers you in either situation.

Hostnames and Name Resolution

# Show the current hostname and related system details
hostnamectl

# Set a new static hostname
sudo hostnamectl set-hostname server1.example.com

# Resolve a hostname to an IP address
getent hosts example.com

# View statically defined host entries
cat /etc/hosts
Note/etc/hosts is checked before DNS by default, which makes it a quick way to override name resolution for testing — for example, pointing a hostname at a specific IP without touching DNS configuration.

Testing Connectivity

# Test basic reachability to a host
ping server1.example.com

# Send only 4 packets, then stop
ping -c 4 server1.example.com

# Test whether a specific TCP port is reachable
curl -v telnet://server1.example.com:22
Tip — A Simple Troubleshooting Order — When connectivity fails, check in order: can you ping the gateway? Can you ping something outside the local network by IP? Can you resolve a hostname to an IP at all? Each answer narrows down whether the problem is local addressing, routing, or DNS.

Key Terms for Chapter 17

IP address
A unique numeric identifier assigned to a device on a network
subnet mask / CIDR
Defines which portion of an address represents the network versus the host
default gateway
The router used to reach destinations outside the local network
NetworkManager
The service that manages network interfaces and connections on RHEL
connection profile
A saved NetworkManager configuration that can be applied to a device
nmcli
Command-line tool for querying and configuring NetworkManager
nmtui
Text-based menu interface for configuring NetworkManager interactively
DNS
The system that translates hostnames into IP addresses

Review Questions

  1. What does a subnet mask determine about an IP address?
  2. What is the difference between a network "device" and a "connection" in NetworkManager terms?
  3. Write the two nmcli commands needed to switch a connection named eth0 from DHCP back to automatic (DHCP) addressing.
  4. After running nmcli connection modify, why might your change not seem to take effect immediately?
  5. What command would you use to interactively configure networking through a menu during an SSH session, without memorizing exact nmcli syntax?
  6. What file can you edit to statically map a hostname to an IP address without touching DNS?
  7. Describe a sensible troubleshooting order if a system suddenly can't reach a website by hostname.
1 / 11