Home / Why are scripts under /etc/sysconfig/network-scripts directory are gone on AlmaLinux 8/AlmaLinux 9?

Why are scripts under /etc/sysconfig/network-scripts directory are gone on AlmaLinux 8/AlmaLinux 9?

Some of the issues faced by system engineers are;

Why are files in /etc/sysconfig/network-scripts ignored? Where are interface configs now?

I changed a config in an ifcfg-file in directory /etc/sysconfig/network-scripts. Why does the system ignore these changes?

A configuration file for each interface should be placed in either the /etc/NetworkManager/system-connections or the /etc/sysconfig/network-scripts directory for RHEL8 and RHEL9, depending on best practices. It is best to use the older or newer of these two directories.

It is suggested that you solely use system-connections rather than dispersing your configuration files between the two directories for simpler maintenance.

On AlmaLinux 8 only

If the /etc/sysconfig/network-scripts scripts are required, the installation of the deprecated network scripts in the system is still possible with the following command.

# yum install network-scripts

The ifup and ifdown scripts link to the installed legacy network scripts after that package is installed. A notice regarding their deprecation is displayed when the legacy network scripts are called.

On AlmaLinux 9 only

The network-scripts package has been removed. Use NetworkManager to configure connections.

Purchase Dedicated Servers

Select, configure, and buy!

Root Cause Analysis

The network routines are no longer included by default as of AlmaLinux8. The default installation of AlmaLinux8 later includes an updated version of the ifup and ifdown scripts that use the nmcli tool to invoke the NetworkManager service.

The ifup and ifdown scripts for AlmaLinux8 must be executed while NetworkManager is active. The /sbin/ifup-local, ifdown-pre-local, and ifdown-local scripts do not run any custom commands.

The /etc/sysconfig/network-scripts, also known as ifcfg-rh, is no longer the main source for network interfaces in RHEL9, according to the release notes.

[root@AlmaLinux9 ~]# NetworkManager --print-config
# NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf

[main] # plugins=keyfile,ifcfg-rh
[...] [root@AlmaLinux9 ~]#

The default settings for NetworkManager are;

First, seek for files in the keyfile format in the /etc/NetworkManager/system-connections directory, then checking for files in the traditional ifcfg-rh format in /etc/sysconfig/network-scripts

When an interface's files are created in both directories, /etc/NetworkManager/system-connections are used since it is given priority. The interfaces configuration file in the other directory won't be updated.

A straightforward keyfile might resemble this.

[connection] id=Main eth0
uuid=27afa607-ee36-43f0-b8c3-9d245cdc4bb3
type=802-3-ethernet
autoconnect=true

[ipv4] method=auto

[802-3-ethernet] mac-address=00:00:5e:00:53:00

NetworkManager may be informed of keyfile changes using the nmcli con reload command.

Purchase Dedicated Servers

Select, configure, and buy!

Leave a Reply