AlmaLinux 10 Network Configuration Guide
Network configuration forms the foundation of any successful AlmaLinux deployment. Whether you’re managing enterprise servers or home lab environments, understanding how to properly configure network interfaces ensures reliable connectivity and optimal performance. This comprehensive guide covers everything from basic interface management to advanced networking scenarios, providing you with the knowledge to handle any AlmaLinux network configuration challenge.
AlmaLinux utilizes NetworkManager as its primary network management service, offering multiple configuration methods including command-line tools, text-based interfaces, and graphical utilities. This flexibility makes it suitable for both headless servers and desktop environments, ensuring administrators can choose the most appropriate method for their specific use case.
Understanding AlmaLinux Network Management
NetworkManager Service Overview
NetworkManager serves as the default network management daemon in AlmaLinux, providing dynamic network control and configuration capabilities. This service automatically handles network interface detection, configuration management, and connection state monitoring. Unlike traditional network scripts, NetworkManager offers superior handling of mobile devices, wireless connections, and complex networking scenarios.
The service operates continuously in the background, monitoring network conditions and automatically reconnecting when interfaces become available. NetworkManager maintains connection profiles that store network configuration parameters, making it easy to switch between different network environments or restore previous configurations.
To verify NetworkManager status, use the following command:
sudo systemctl status NetworkManager
Available Network Configuration Tools
AlmaLinux provides several tools for network configuration, each suited for different scenarios and user preferences:
- nmcli represents the most powerful command-line interface for NetworkManager operations. This tool enables complete network management through scripting and automation, making it ideal for server environments and batch operations.
- nmtui offers a text-based user interface that combines ease of use with command-line accessibility. This tool provides menu-driven configuration options while remaining functional over SSH connections.
- GUI tools include GNOME’s network settings panel, providing point-and-click configuration for desktop environments. These graphical interfaces simplify network configuration for users who prefer visual interaction.
- Configuration files allow direct editing of network settings in
/etc/sysconfig/network-scripts/
. This method provides maximum control but requires careful attention to syntax and formatting.
Network Interface Naming Conventions
Modern AlmaLinux systems use predictable network interface names, replacing the traditional eth0, eth1 naming scheme. Common interface prefixes include:
- ens: Ethernet interfaces with fixed slot numbers
- enp: PCI Ethernet interfaces with bus and slot information
- wlan: Wireless LAN interfaces
- lo: Loopback interface for local communication
Understanding these naming conventions helps identify and manage network interfaces effectively across different hardware configurations.
Basic Network Interface Management
Checking Current Network Configuration
Before making configuration changes, assess your current network status using multiple diagnostic commands. The ip addr
command provides comprehensive interface information:
ip addr show
This command displays all network interfaces, their assigned IP addresses, and current operational states. Look for interfaces marked as “UP” indicating active status, and note any assigned IP addresses.
Use nmcli
to check NetworkManager-managed connections:
nmcli connection show
This command lists all configured connection profiles, showing which connections are currently active and their associated network interfaces.
Identifying Network Interfaces
Network interface identification requires understanding both physical and logical interface designations. Execute the following command to list all available interfaces:
nmcli device status
The output shows device names, types, states, and associated connections. Physical interfaces typically show as “ethernet” type, while virtual interfaces may appear as “bridge,” “bond,” or “vlan” types.
For detailed interface information including driver details and hardware capabilities, use:
sudo ethtool ens160
Replace “ens160” with your actual interface name to view hardware-specific information including link status, speed, and duplex settings.
Basic Interface Operations
NetworkManager provides straightforward commands for basic interface operations. To bring an interface online:
sudo nmcli connection up "connection-name"
To disable an interface temporarily:
sudo nmcli connection down "connection-name"
For immediate interface control at the kernel level, use ip commands:
sudo ip link set ens160 up
sudo ip link set ens160 down
These operations take effect immediately but may not persist across system reboots unless accompanied by configuration changes.
Configuring DHCP Network Connections
Understanding DHCP Configuration
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, gateways, and DNS servers to network interfaces. This configuration method works well for client machines and environments where centralized IP management is preferred.
DHCP provides several advantages including simplified network management, automatic IP conflict resolution, and centralized configuration updates. However, servers typically require static IP addresses for consistent accessibility.
Setting Up DHCP Using nmcli
Creating a new DHCP connection requires specifying the connection name, interface type, and device binding:
sudo nmcli connection add con-name "dhcp-connection" type ethernet ifname ens160 ipv4.method auto
This command creates a new connection profile configured for automatic IP assignment. The ipv4.method auto
parameter instructs NetworkManager to use DHCP for IPv4 configuration.
To modify an existing connection for DHCP usage:
sudo nmcli connection modify "existing-connection" ipv4.method auto
sudo nmcli connection up "existing-connection"
DHCP Configuration via GUI
For desktop environments, GNOME’s network settings provide intuitive DHCP configuration. Access network settings through the system menu, select your network interface, and choose “Automatic (DHCP)” for IPv4 configuration.
The graphical interface automatically applies changes and shows connection status in real-time, making it ideal for troubleshooting and verification.
DHCP Troubleshooting
Common DHCP issues include lease expiration, server unavailability, and configuration conflicts. To renew a DHCP lease manually:
sudo nmcli connection down "connection-name"
sudo nmcli connection up "connection-name"
Check DHCP client logs for detailed troubleshooting information:
sudo journalctl -u NetworkManager | grep dhcp
If DHCP assignment fails, verify network connectivity and DHCP server availability using ping tests to the default gateway.
Static IP Address Configuration
When to Use Static IP Addresses
Static IP addresses provide consistent network accessibility, making them essential for servers, printers, and network infrastructure devices. Unlike DHCP assignments, static IPs never change unless manually reconfigured, ensuring reliable connectivity for services that depend on fixed addressing.
Consider static IP configuration for database servers, web servers, network attached storage, and any device requiring consistent remote access. Static addressing also simplifies firewall configuration and network documentation.
Static IP Configuration Using nmcli
Configure static IP addresses using nmcli with comprehensive parameter specification:
sudo nmcli connection add con-name "static-connection" type ethernet ifname ens160 ipv4.method manual ipv4.addresses "192.168.1.100/24" ipv4.gateway "192.168.1.1" ipv4.dns "8.8.8.8,8.8.4.4"
This command creates a complete static configuration including IP address, subnet mask, gateway, and DNS servers. The /24
notation indicates a 255.255.255.0 subnet mask.
For existing connections, modify parameters individually:
sudo nmcli connection modify "connection-name" ipv4.method manual
sudo nmcli connection modify "connection-name" ipv4.addresses "192.168.1.100/24"
sudo nmcli connection modify "connection-name" ipv4.gateway "192.168.1.1"
sudo nmcli connection modify "connection-name" ipv4.dns "8.8.8.8,8.8.4.4"
Static IP Configuration Using nmtui
The nmtui
utility provides menu-driven static IP configuration suitable for terminal-only environments. Launch the utility with:
sudo nmtui
Navigate through the interface using arrow keys and select “Edit a connection.” Choose your network interface and modify IPv4 configuration from “Automatic” to “Manual.” Enter your desired IP address, subnet mask, gateway, and DNS servers using the provided fields.
Static IP Configuration via Configuration Files
Direct configuration file editing provides maximum control over network settings. Configuration files reside in /etc/sysconfig/network-scripts/
with names like ifcfg-ens160
.
Create or edit the interface configuration file:
sudo nano /etc/sysconfig/network-scripts/ifcfg-ens160
Add the following configuration parameters:
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.100
PREFIX=24
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEVICE=ens160
After editing, restart NetworkManager to apply changes:
sudo systemctl restart NetworkManager
Static IP Configuration via GUI
GNOME desktop users can configure static IP addresses through the graphical network settings panel. Click the network icon in the top-right corner, select “Wired Settings,” and click the gear icon next to your connection.
Navigate to the IPv4 tab, select “Manual,” and enter your IP address, netmask, gateway, and DNS servers. Click “Apply” to save the configuration and activate the new settings immediately.
DNS Configuration and Management
Understanding DNS in AlmaLinux
DNS (Domain Name System) resolution converts human-readable domain names into IP addresses, enabling network communication. AlmaLinux manages DNS configuration through NetworkManager, which maintains resolver settings in /etc/resolv.conf
.
NetworkManager automatically updates DNS configuration when network connections change, ensuring consistent name resolution across different network environments.
Configuring DNS Servers
Set DNS servers for specific connections using nmcli:
sudo nmcli connection modify "connection-name" ipv4.dns "8.8.8.8,1.1.1.1"
For multiple DNS servers, separate addresses with commas. Primary DNS servers receive queries first, with secondary servers providing failover capability.
To add DNS servers to existing configurations:
sudo nmcli connection modify "connection-name" +ipv4.dns "9.9.9.9"
The plus sign adds the DNS server to existing entries rather than replacing them.
DNS Troubleshooting
Test DNS resolution using dig or nslookup commands:
dig google.com
nslookup google.com
These tools reveal DNS query paths and response times, helping identify resolution problems. If DNS queries fail, verify DNS server connectivity:
ping 8.8.8.8
Check current DNS configuration:
cat /etc/resolv.conf
This file shows active DNS servers and search domains configured by NetworkManager.
Advanced Network Configuration
Network Bonding and Teaming
Network teaming combines multiple physical interfaces into a single logical interface, providing increased bandwidth and redundancy. AlmaLinux supports various teaming modes including active-backup, load balancing, and round-robin distribution.
Active-backup mode provides failover capability with one interface active and others standing by. Load balancing distributes traffic across all team members for increased throughput.
Setting Up Network Teaming
Install required packages for network teaming functionality:
sudo dnf install teamd NetworkManager-team
Create a team interface using nmcli:
sudo nmcli connection add type team con-name team0 ifname team0 team.config '{"runner": {"name": "activebackup"}}'
Add slave interfaces to the team:
sudo nmcli connection add type ethernet slave-type team con-name team0-port1 ifname ens160 master team0
sudo nmcli connection add type ethernet slave-type team con-name team0-port2 ifname ens161 master team0
Configure IP addressing for the team interface:
sudo nmcli connection modify team0 ipv4.method manual ipv4.addresses "192.168.1.100/24" ipv4.gateway "192.168.1.1"
Network Bridging Configuration
Bridge interfaces enable virtual machine networking and container connectivity. Create a bridge interface:
sudo nmcli connection add type bridge con-name br0 ifname br0
sudo nmcli connection add type ethernet slave-type bridge con-name bridge-slave ifname ens160 master br0
Configure bridge IP addressing:
sudo nmcli connection modify br0 ipv4.method manual ipv4.addresses "192.168.1.100/24" ipv4.gateway "192.168.1.1"
VLAN Configuration
Virtual LANs (VLANs) provide network segmentation within physical infrastructure. Create VLAN interfaces for specific network segments:
sudo nmcli connection add type vlan con-name vlan100 ifname ens160.100 dev ens160 id 100
Configure VLAN addressing:
sudo nmcli connection modify vlan100 ipv4.method manual ipv4.addresses "10.100.1.10/24"
Network Security and Firewall Integration
Firewall Configuration Considerations
AlmaLinux includes firewalld for zone-based firewall management. Network interfaces automatically assign to firewall zones, determining allowed traffic patterns.
Check current zone assignments:
sudo firewall-cmd --list-all-zones
Assign interfaces to specific zones:
sudo firewall-cmd --zone=public --change-interface=ens160 --permanent
sudo firewall-cmd --reload
Network Security Best Practices
Implement network security through careful interface management and access controls. Disable unused network interfaces to reduce attack surface:
sudo nmcli connection down "unused-connection"
Configure appropriate firewall rules for enabled services:
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --reload
Troubleshooting Network Issues
Common Network Problems
Network connectivity issues often stem from configuration errors, hardware problems, or service failures. Systematic troubleshooting helps identify and resolve these problems efficiently.
Common symptoms include complete connectivity loss, partial network access, slow performance, and intermittent connection drops.
Diagnostic Tools and Commands
Use comprehensive diagnostic tools for network troubleshooting:
ping -c 4 8.8.8.8
traceroute google.com
sudo ss -tuln
sudo netstat -rn
These commands test connectivity, trace network paths, show listening services, and display routing tables.
Monitor real-time network activity:
sudo tcpdump -i ens160
sudo iftop -i ens160
Network Service Management
Restart NetworkManager to resolve service-related issues:
sudo systemctl restart NetworkManager
Check service status and logs:
sudo systemctl status NetworkManager
sudo journalctl -u NetworkManager -f
For emergency network recovery, manually configure interfaces:
sudo ip addr add 192.168.1.100/24 dev ens160
sudo ip route add default via 192.168.1.1
Best Practices and Maintenance
Configuration Management
Maintain network configuration backups for disaster recovery purposes. Export NetworkManager profiles:
sudo nmcli connection show --active
sudo cp -r /etc/sysconfig/network-scripts/ /backup/network-configs/
Document all network changes including IP assignments, VLAN configurations, and routing modifications.
Monitoring and Maintenance
Implement regular network health monitoring using built-in tools:
sudo dnf install -y nload iftop
nload ens160
sudo iftop -i ens160
Schedule periodic connectivity tests:
# Add to crontab
*/5 * * * * ping -c 1 8.8.8.8 >> /var/log/network-health.log
Update and Upgrade Considerations
Plan network configuration preservation during system updates. NetworkManager configurations typically survive upgrades, but verify settings after major version updates.
Test network functionality immediately after system updates and maintain rollback procedures for critical configurations.