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:
- nmtui, is a user-friendly graphical environment for configuring and creating interfaces;
- nmcli, is a utility for editing and creating interfaces via the command line;
- any text editor that can be used to edit configuration files.
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.
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:
After that, you need to install a text editor and network management utilities:
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:
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:
There are many variations of interface management and network connection settings in the menu, let's go to Edit a connection:
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.
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 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:
Or use a daemon call to reboot:
After that, be sure to verify the changes and addressing of the new interface:
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:
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:
Below is the configuration of the file:
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:
- connection is responsible for the basic interface parameters;
- ethernet identifies the interface to which the configuration should be applied;
- ipv4 is a block for configuring IPv4 operation. In this example, manual was selected, where address/network_mask, dns_server was specified;
- ipv6 is a block for configuring ipv6 operation, disabled;
- proxy is a configuration block for proxy.
After making the changes, save the file and apply the settings with the command:
After that it is necessary to check the settings and make sure that the network is functioning correctly via the ping command!