cd ..
EN
Networking
Mastering the Network: Static IP Configuration in AlmaLinux
R
Rodolfo Echenique
Automated Translation: This article was originally written in Spanish and translated by Gemini AI.
As a Senior Network Engineer at Central Node, I have seen countless server configurations. One universal truth in our field is that stability begins with a solid network foundation. I have analyzed the information and share this enhanced guide for setting static IP addresses on AlmaLinux, the spiritual successor to CentOS in the enterprise environment.
In the world of servers, relying on DHCP (Dynamic Host Configuration Protocol) for your main machine is like playing Russian roulette with your connectivity. Servers need known, fixed addresses so that services, applications, and users can always find them in the same "location."
AlmaLinux, as an enterprise-class distribution, uses to manage connections. Although it sounds intimidating, the command-line tool is surprisingly powerful, and once you get the hang of it, it is the fastest way to configure networks without touching configuration files prone to human error.
NetworkManagernmcliStep 1: Reconnaissance (Verify Interfaces)
Before starting to fire off commands, we need to know what we are aiming for. It is crucial to identify the correct name of the physical network interface we are going to configure (you don't want to configure your loopback interface by accident).
Run the following command in your terminal to list all network devices:
nmcli device status
This command will give you a clean output showing the device (DEVICE), its type (TYPE), and its current state (STATE). Look for your primary Ethernet interface; it commonly has names like , , or , and its state should be "connected."
eth0ens192ens33Let's assume for this example that your interface is named ens192.
Step 2: Configuration (Surgical Precision)
Once the victim... sorry, the interface, is identified, we will proceed to change its configuration. We will use the (connection modify) command to alter the connection parameters.
nmcli con mod-
Change the method to manual:
First, we tell NetworkManager: "Hey, stop requesting an IP from the router, I'll take care of it." This avoids future conflicts with DHCP.sudo nmcli con mod ens192 ipv4.method manual -
Define network parameters:
This is where the magic happens. We are going to set the IP address, the subnet mask (using CIDR notation, like /24), the default gateway, and the DNS servers in a single efficient line.Real scenario example:- Desired IP: 192.168.1.100
- Mask: 255.55.255.0 (which equals /24)
- Gateway: 192.168.1.1
- DNS: We will use the classic Google ones for this example (8.8.8.8, 8.8.4.4), although in a corporate environment you would use your internal DNS.
The command would be:sudo nmcli con mod ens192 ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns "8.8.8.8 8.8.4.4"Note: Observe how the DNS servers are in quotes and separated by a space. Details matter!
Step 3: Apply and Verify (The Test of Fire)
In Linux, configuring something does not mean it is applied instantly. It's like writing an email and not hitting "Send." We need to restart the interface for the changes to take effect.
Bring the connection down and bring it back up:
sudo nmcli con down ens192 && sudo nmcli con up ens192
(If you are connected via SSH, cross your fingers. If you did everything correctly, your session will reconnect in a couple of seconds. If not... well, I hope you have access to the physical or virtual console).
Final Verification
Never trust blindly. Verify that the IP has been assigned correctly:
ip addr show ens192
Look for the line that says . If it's there, congratulations!
inet 192.168.1.100/24💡 Central Node Professional Tip:
Just seeing the IP is not enough. Test real connectivity. Try pinging your gateway () and then an external address () to ensure that routing and internet access are working correctly.
ping 192.168.1.1ping 8.8.8.8Conclusion
Configuring a static IP address in AlmaLinux using is an essential skill for any system administrator. It is a clean, efficient, and, above all, scriptable process.
nmcliMaintaining control over your IP addressing is the first step toward a robust and predictable infrastructure.
Does your network infrastructure need an expert review?
At Central Node, we don't just configure IPs; we design, secure, and optimize complex network architectures for critical environments. Let our experts with over a decade of experience handle the technological foundation of your business.
AlmaLinux Linux Networking IP Estática nmcli NetworkManager Configuración de Servidores Infraestructura IT Redes Linux Guía Técnica SysAdmin DevOps Networking Tutorial CLI Enterprise Linux Central Node Mejores Prácticas IT Seguridad de Red Operaciones de Servidor TCP/IP Gestión de Redes