12.04.2024

Configure network for Alma Linux

One of the first steps in configuring a freshly installed distribution is to configure the machine interfaces. Depending on the role of the computing device, different types of connection schemes and configurations are possible. Let's consider the example of Alma Linux different types of network configuration. The presented distribution uses Network Manager service, which allows configuration via CLI and GUI.

How do I open Network Manager?

Network Manager is a service installed in Alma Linux distribution by default. It is a tool for managing network interfaces and their settings.

In order to open Network Manager it is necessary to use one of the convenient tools for interaction:

Once the list of tools has been defined, let's move on to configuring the network interfaces on the machine!

Server preparation

GPG or GNU Privacy Guard is a crypto package that allows you to encrypt, decrypt, sign documents and messages with EDS, store keys with identifiers in a database, and perform many cryptosystem functions. Just one of these is signature verification on apt packages.

All actions we can do in isolate environment on Serverspace cloud platform which will help in easy deployment, also you can skip this step if you have a cloud server. To create the node we need to find the cloud platform from the left menu which you can choose depending on your requirement. We choose vStack or VMware platform and click on Create Server button.

Screenshot №1 — Create machine

It will take some time to deploy server capacity. After that you can connect in any of the convenient ways. Let's return to our terminal with the action of update packets, that we can do by command:

dnf update && dnf upgrade -y

Screenshot №2 — Update packages

After that, you need to install a text editor and network management utilities:

dnf install nano net-tools -y

Screenshot №3 — Software installation

The net-tools utility will help you take a closer look at the network configuration on your system and make additional settings!

Configuring network interfaces

First, physically or virtually connect the network interface to the computing device and check its availability with the command:

ip a

Screenshot №4 — Check network interfaces

In the list of network interfaces we can find already configured interfaces such as lo and ens160. As well as the interface ens224, which is just to be configured. For the configuration, as it was already mentioned, it is necessary to use one of the presented tools. For graphical configuration let's open the nmtui utility with the command in the terminal:

sudo nmtui

Screenshot №5 — NMTUI

There are many variations of interface management and network connection settings in the menu, let's go to Edit a connection:

Screenshot №6 — Editor connections

First, select the interface of interest and configure the connection on it by selecting Edit in the right column. Optionally, you can change the Profile name field, Device remains unchanged. It is necessary to specify the configuration protocol, the default is Automatic, which means that the settings will be received through DHCP. If it is necessary to specify the settings manually, Manual mode will be used. It can be changed against the IPv4 Configuration item.

Screenshot №7 — Change configuration

In manual mode, we will specify the address of the device itself with its network mask, which will allow us to determine the address of the network and the number of devices that can be in it. This setting allows you to implement the segmentation mechanism at the network level and isolate sections from each other.

If there is an existing default gateway on a different interface, select Never use this network for default route!

If your system requirements do not require the use of IPv6, you should disable configuration at this address for security reasons. After the configuration is complete, apply the changes by clicking OK. Reload the network settings:

nmcli connection reload

Or use a daemon call to reboot:

systemctl restart NetworkManager

After that, be sure to verify the changes and addressing of the new interface:

ip a

Screenshot №8 — Result of changes

If you are using a server with a standard set of utilities or for any other reason you do not have nmtui installed, you can always use the configuration via a file. To do this, navigate to the network interfaces configuration folder:

cd /etc/NetworkManager/system_connections

Screenshot №9 — Open configuration file

If there is a configuration file, open it, if not, create it. It is necessary to take into account the format of the file, for example, the name can be name-of-interface.nmconnection:

nano ens160.nmconnection

Screenshot №10 — Configuration file

Below is the configuration of the file:

[connection]
id=ens224
uuid-0cf73338-b478-1c0c-83b7-c9babb882f53
type-ethernet
timestamp=1712755359
[ethernet]
mac-address=00:0C:29:07:2A:32
[ipv4]
address1=172.20.10.3/28,172.20.10.1
dns=8.8.8.8:
method=manual
[ipv6]
method=disable
[proxy]

The screenshot shows the configuration blocks to be used for configuration:

After making the changes, save the file and apply the settings with the command:

systemctl restart NetworkManager

After that it is necessary to check the settings and make sure that the network is functioning correctly via the ping command!