Managing AlmaLinux networking and firewall: connection configuration with NetworkManager and nmcli, static IP and DNS, bonding, VLANs, and bridges, then building perimeter defense with zone-based firewalld, rich rules, and masquerade for NAT.

In the previous episode, Episode 8, we set up storage and filesystems. Now we deal with a server's lifeline: networking. A server that can't be reached over the network is as good as useless — and a server with a loose firewall is an invitation to attackers.
This episode covers two sides of the same coin: NetworkManager as the manager of network configuration, and firewalld as its perimeter defense. You'll learn to set up IPs, DNS, bonding, and VLANs, then build correct firewall zones.
NetworkManager is AlmaLinux's default network manager. Configuration is handled through connection profiles — files that store all settings for a connection, such as IP addresses and DNS.
nmcli device status
nmcli connection shownmcli device status shows physical devices, while nmcli connection show shows connection profiles. Together they give you a map of your system's network.
| Command | Function |
|---|---|
nmcli connection show <name> | Connection profile details |
nmcli connection up <name> | Activates a connection |
nmcli connection down <name> | Deactivates a connection |
nmcli general hostname | Shows the hostname |
Most servers need a static IP, not DHCP. Create a new profile or modify an existing one:
sudo nmcli connection modify ens192 ipv4.method manual ipv4.addresses 192.168.1.10/24 ipv4.gateway 192.168.1.1 ipv4.dns 1.1.1.1
sudo nmcli connection up ens192Tip
Network configuration on AlmaLinux should be done through NetworkManager (nmcli) — not ifconfig or ip directly — so changes stay consistent and are saved as profiles. For a friendlier text interface, try nmtui, which offers a TUI-based menu.
sudo hostnamectl set-hostname app1.lab.local
hostnamectlhostnamectl also shows the operating system, kernel, and hardware information — one of the first diagnostic commands you should master.
Bonding combines multiple physical NICs into one logical link — for redundancy (failover) and throughput:
sudo nmcli connection add type bond con-name bond0 ifname bond0 bond.options mode=active-backup
sudo nmcli connection add type ethernet con-name ens192 ifname ens192 master bond0
sudo nmcli connection add type ethernet con-name ens224 ifname ens224 master bond0The active-backup mode uses one active NIC with the rest on standby — when the primary NIC fails, traffic moves over automatically.
VLANs separate traffic logically over a single physical link:
sudo nmcli connection add type vlan con-name bond0.100 ifname bond0.100 vlan.id 100 vlan.parent bond0A bridge combines several interfaces into one network — the standard for virtualization:
sudo nmcli connection add type bridge con-name br0 ifname br0
sudo nmcli connection add type ethernet con-name ens192 ifname ens192 master br0firewalld is a dynamic firewall based on zones. A zone is a set of rules that determines a network's trust level. The concept: network devices (not just interfaces) are grouped into zones, and each zone has its own open/close rules.
| Zone | Characteristics |
|---|---|
public | Default; low trust, most ports closed |
internal | Medium trust for internal networks |
trusted | All connections accepted |
drop | All incoming connections dropped without reply |
firewall-cmd --get-default-zone
firewall-cmd --get-active-zonesThe cleanest way to open a service is using a service — a named definition containing a set of ports:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reloadsudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reloadWarning
Always add --permanent so changes survive a reboot, then --reload to apply them. Changing only at runtime (without --permanent) is lost when the firewall restarts — and the runtime vs permanent difference is the most common source of confusion with firewalld.
Firewalld distinguishes two states:
The recommended safe pattern: add rules with --permanent, then --reload to apply them to the runtime.
For granular control, use rich rules — expressive rules that can filter by source address:
sudo firewall-cmd --permanent --zone=internal --add-rich-rule='rule family=ipv4 source address=192.168.1.0/24 port port=22 protocol=tcp accept'
sudo firewall-cmd --reloadMasquerade is a form of NAT (Network Address Translation) that hides an internal network behind one public IP — the standard pattern for gateways/routers:
sudo firewall-cmd --permanent --zone=external --add-masquerade
sudo firewall-cmd --reload--permanent. Rules that are runtime-only are lost on reload — always add --permanent.ifconfig. Use nmcli so changes are saved as NetworkManager profiles.--get-active-zones.In this episode 9 you've mastered AlmaLinux networking and firewall: connection configuration with NetworkManager and nmcli, static IP and DNS, hostname, bonding, VLANs, and bridges, plus building a zone-based firewall with firewall-cmd, rich rules, and masquerade for NAT.
Key takeaways:
nmcli and NetworkManager profiles, not ifconfig.ipv4.method manual; test with nmcli connection up.public, internal, and trusted.--permanent + --reload for persistent changes.Well-organized networking and firewalls let your services be accessed securely. In the next episode, Episode 10, we'll cover Kernel, Boot & Kernel Modules — the boot process from firmware to systemd, GRUB2 and initramfs management, kernel version management with grubby, sysctl tuning, and kernel module management with modprobe. See you there!