RH124 Ch 12: Networking with NetworkManager

NetworkManager owns network configuration on RHEL. A device is an interface (eth1); a connection (profile) is saved settings applied to a device. RHEL 10 stores profiles as keyfiles in /etc/NetworkManager/system-connections/.

Inspect - ip -br addr, ip route, ip -6 addr — what is active now. - nmcli dev status, nmcli con show, nmcli con show eth1 — what is configured.

Configure (persistently) nmcli con mod eth1 ipv4.method manual ipv4.addresses 192.0.2.10/24 \ ipv4.gateway 192.0.2.254 ipv4.dns 192.0.2.254 ipv4.dns-search example.com nmcli con mod eth1 +ipv4.addresses 192.0.2.20/24 add a second address nmcli con mod eth1 ipv6.method manual ipv6.addresses fd00::10/64 nmcli con up eth1 apply now - New profile: nmcli con add con-name lab type ethernet ifname eth1 ipv4.method manual ipv4.addresses …. - connection.autoconnect yes makes it come up at boot. - nmtui is a menu-driven alternative; man nmcli-examples has ready-made commands.

Names - hostnamectl hostname server.example.com sets the permanent name (/etc/hostname). - /etc/hosts maps names locally; DNS servers come from the connection and land in /etc/resolv.conf. /etc/nsswitch.conf decides the order (files, then DNS). - Test with getent hosts name (uses the same path as applications), host or dig (DNS only), and ping.

Exam traps: ip addr add is not persistent; ipv4.addresses without + replaces existing addresses; forgetting nmcli con up; setting a DNS server but leaving ipv4.ignore-auto-dns off on DHCP connections.