LFCS study materials
LFCS study resources

LFCS: Networking

LFCS · Work through your exam, one topic at a time.

All guide sections

Networking

Addresses, routes, and listeners

Modern Linux networking questions usually expect ip and ss, not legacy ifconfig and netstat. Understand the layers: a link/interface has an address, routing decides where packets go, and DNS resolves names. ip addr show displays addresses; ip route show displays routes, including the default route; ip link set dev eth0 up changes link state. ss -tulpn shows listening TCP/UDP sockets, numeric ports, and processes where permitted.

Persistence matters. ip addr add and ip route add are temporary and vanish after reboot. NetworkManager is commonly managed with nmcli. A static IPv4 configuration typically modifies a connection profile, not just the device: set ipv4.method manual, ipv4.addresses, ipv4.gateway, and ipv4.dns, then bring the connection up. Use nmcli connection show to find the profile name; device names and connection names are not interchangeable.

Traps: ping tests reachability but not DNS correctness; use getent hosts name to test name resolution through the system resolver. ss may hide process information without privileges. A missing default route breaks off-subnet access even when the local address is correct. Firewall tools such as firewall-cmd or ufw can block traffic that ss shows as listening, so check both service and firewall state.

Worked rule of thumb: after any network change, verify in order: ip addr, ip route, DNS via getent hosts, then a listener via ss -tulpn. If local access works but remote access fails, suspect the default route, firewall, or service binding to 127.0.0.1 instead of 0.0.0.0.