AlmaLinux is a Linux distribution that is designed to be a free and open-source enterprise-grade operating system. Like any other operating system, network configuration is an essential aspect of using AlmaLinux. This blog will guide you through the process of configuring and managing network settings in AlmaLinux.
Before we start, it’s essential to understand that there are two ways to configure network settings in AlmaLinux: via the command line or via the graphical user interface (GUI). In this blog, we will cover both methods.
Configuring network settings via the command line:
Step-1: Open the terminal
To open the terminal in AlmaLinux, click on the Applications menu in the top left corner, and type “Terminal” in the search bar. Click on the Terminal application to open it.
Step-2: Check your network connection
Before configuring your network settings, you need to know the name of your network interface. To check your network connection, use the following command:
ip addr show
This command will display information about all the network interfaces on your system. Look for the network interface name, which will typically be “eth0” or “enp0s3.”
Step-3: Configure the network interface
Once you know the name of your network interface, you can configure it using the following command:
sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
Replace “eth0” with the name of your network interface. This command will open the network configuration file in the nano text editor.
Step-4: Set the network configuration
In the nano editor, you will see a list of network configuration options. Here are the most important ones:
- BOOTPROTO: This option specifies the protocol used by the network interface to obtain an IP address. Set it to “dhcp” if you want to obtain an IP address automatically from a DHCP server, or set it to “static” if you want to set a static IP address manually.
- IPADDR: If you set BOOTPROTO to “static,” use this option to specify the IP address you want to assign to your network interface.
- NETMASK: If you set BOOTPROTO to “static,” use this option to specify the network mask for your network interface.
- GATEWAY: If you set BOOTPROTO to “static,” use this option to specify the IP address of your network gateway.
Once you have made your changes, press Ctrl+X to exit the nano editor, and press Y to save your changes.
Step-5: Restart the network service
To apply your network configuration changes, you need to restart the network service using the following command:
sudo systemctl restart network
Configuring network settings via the GUI:
Step-1: Open the network settings
To open the network settings in AlmaLinux, click on the Applications menu in the top left corner, and type “Network” in the search bar. Click on the Network Settings application to open it.
Step-2: Configure the network interface
In the Network Settings application, you will see a list of network interfaces. Select the interface you want to configure, and click on the gear icon next to it.
Step-3: Set the network configuration
In the network configuration window, you will see several options to configure your network interface. Here are the most important ones:
- IPv4: This option allows you to configure your network interface with an IPv4 address. Set it to “Automatic (DHCP)” if you want to obtain an IP address automatically from a DHCP server, or set it to “Manual” if you want to set a static IP address manually.
- Address: If you set IPv4 to “Manual,” use this option to specify the IP address you want to assign to your network interface.