CHAPTER 8 — PRESENTATION

Network Configuration

From legacy ifconfig to modern ip and netplan — master every method for configuring network interfaces on Linux. Covers NetworkManager, nmcli, static IP, DHCP, and the /etc/network/interfaces approach.

Slide 1 — Network Interfaces Overview

Understanding Linux Network Interface Naming

Linux network interfaces were historically named eth0, eth1, wlan0 — simple sequential names assigned at boot. Modern systems use predictable network interface names (also called "biosdevnames") assigned by systemd based on hardware topology.

These predictable names eliminate the race condition where two NICs could swap names between reboots, which caused serious issues in server environments.

# Predictable name prefixes: # en = Ethernet (enp0s3, enp3s0, ens3) # wl = Wireless (wlp8s0, wlan0) # ww = WWAN (mobile broadband) # lo = Loopback (always lo) # p = PCI bus, s = slot, o = on-board, x = MAC address # enp0s3 = Ethernet, PCI bus 0, slot 3 # List all network interfaces ip link show ip addr # shows interfaces + IP addresses # Find interface from hardware lshw -class network # detailed hardware info lspci | grep -i network # PCI device listing
Slide 2 — ifconfig vs ip Command
ifconfig
LEGACY (deprecated)

Part of the net-tools package. Still available on older systems. Replaced by the ip command from iproute2. Many distros no longer install it by default. Use sudo apt install net-tools to restore.

ip
MODERN (iproute2)

The canonical Linux networking tool. Manages interfaces, addresses, routes, tunnels, and more. Part of the iproute2 package, available on all modern distributions. The exam expects you to know this tool.

nmcli
NETWORKMANAGER CLI

CLI frontend to NetworkManager. Ideal for managing connections persistently. Changes survive reboots. Essential on desktop distros and RHEL/CentOS systems where NetworkManager is the default stack.

ip Command — Essential Operations

# View all interfaces and IP addresses ip addr ip addr show enp0s3 # specific interface only # Assign a static IP address sudo ip addr add 192.168.1.100/24 dev enp0s3 # Remove an IP address sudo ip addr del 192.168.1.100/24 dev enp0s3 # Bring an interface up or down sudo ip link set enp0s3 up sudo ip link set enp0s3 down # Add a default gateway (route) sudo ip route add default via 192.168.1.1 # View routing table ip route show ip route # shorthand version # NOTE: ip addr changes are NOT persistent — they vanish on reboot # Use netplan, /etc/network/interfaces, or NetworkManager for persistence
CRITICAL DISTINCTION

The ip command makes changes to the running kernel network configuration only. They survive until the next reboot or interface restart. For persistent configuration you must use netplan (Ubuntu), /etc/network/interfaces (Debian/older), or NetworkManager/nmcli.

Slide 3 — /etc/network/interfaces (Debian Legacy)

Traditional Debian/Ubuntu Network Configuration

Older Debian-based systems used /etc/network/interfaces as the persistent network configuration file. The ifup and ifdown commands read this file and apply the configuration.

# /etc/network/interfaces — static IP configuration example auto lo iface lo inet loopback auto enp0s3 iface enp0s3 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4 # DHCP configuration (automatic address) auto enp0s3 iface enp0s3 inet dhcp # Apply changes after editing the file: sudo ifdown enp0s3 && sudo ifup enp0s3 # Or restart the networking service: sudo systemctl restart networking
Slide 4 — Netplan (Modern Ubuntu Server)

YAML-Based Network Configuration

Ubuntu 17.10+ replaced /etc/network/interfaces with Netplan — a YAML-based network configuration abstraction layer. Netplan generates and applies configurations for either systemd-networkd (server default) or NetworkManager (desktop default) as its renderer.

# Netplan config files live in /etc/netplan/ ls /etc/netplan/ # Typically: 00-installer-config.yaml or 01-netcfg.yaml # Static IP configuration with netplan # File: /etc/netplan/00-installer-config.yaml network: version: 2 renderer: networkd ethernets: enp0s3: addresses: - 192.168.1.100/24 routes: - to: default via: 192.168.1.1 nameservers: addresses: [8.8.8.8, 8.8.4.4] dhcp4: false # DHCP configuration with netplan network: version: 2 ethernets: enp0s3: dhcp4: true # Apply netplan configuration sudo netplan apply # Test configuration before applying (shows errors) sudo netplan try # reverts after 120 sec if no confirmation sudo netplan generate # generate backend configs without applying
NETPLAN FILE PERMISSIONS

Netplan YAML files must have permissions 600 (owner read/write only) or netplan will refuse to parse them and log a warning. Always set correct permissions: sudo chmod 600 /etc/netplan/*.yaml

Slide 5 — NetworkManager & nmcli

NetworkManager — Desktop and RHEL Standard

NetworkManager is the default network management daemon on desktop Linux distributions (GNOME, KDE) and RHEL/CentOS/Fedora server systems. It handles wired, wireless, VPN, and mobile broadband connections, and stores connection profiles persistently.

# nmcli — NetworkManager command-line interface # Show all connections (saved profiles) nmcli connection show # Show active connections nmcli connection show --active # Show device status nmcli device status # Connect to a Wi-Fi network nmcli device wifi connect MySSID password mypassword # Create a static IP connection profile sudo nmcli connection add type ethernet \ con-name static-office \ ifname enp0s3 \ ipv4.method manual \ ipv4.addresses 192.168.1.100/24 \ ipv4.gateway 192.168.1.1 \ ipv4.dns 8.8.8.8 # Activate a saved connection sudo nmcli connection up static-office # Deactivate a connection sudo nmcli connection down static-office # Modify an existing connection sudo nmcli connection modify static-office ipv4.dns 1.1.1.1 sudo nmcli connection up static-office # apply changes
Slide 6 — Testing & Verifying Network Configuration

Verifying Connectivity at Each Layer

# Layer 1/2: Verify interface is up and has an address ip addr show ip link show # Layer 3: Test local loopback (TCP/IP stack working) ping -c 4 127.0.0.1 # Layer 3: Test local subnet (routing within network) ping -c 4 192.168.1.1 # Layer 3: Test remote gateway ping -c 4 8.8.8.8 # DNS resolution test nslookup google.com dig google.com host google.com # Show DNS server in use cat /etc/resolv.conf resolvectl status # systemd-resolved status # Trace route to destination traceroute 8.8.8.8 mtr 8.8.8.8 # interactive traceroute # Show open ports and listening services ss -tulnp # modern replacement for netstat netstat -tulnp # legacy (requires net-tools)
SYSTEMATIC TROUBLESHOOTING ORDER

Always test in order: (1) loopback ping — verifies TCP/IP stack. (2) Gateway ping — verifies local subnet routing. (3) Remote IP ping — verifies internet routing. (4) DNS lookup — verifies name resolution. Failing at step 2 means a routing or addressing issue. Failing only at step 4 means a DNS problem, not a routing problem.

Chapter 8 Complete

Mark this presentation complete to record your progress and unlock the quiz.

Progress saved. Head to the quiz to test your knowledge.