You can restart the network in AlmaLinux 8 by using two methods.
- The preferred one using nmcli is given below.
nmcli networking off && nmcli networking on
- The second method is to install legacy network services as below.
yum install network-scripts
service network restart
Using the second method, you will get the following warning messages in logs.
WARN : [network] You are using 'network' service provided by 'network-scripts', which are now deprecated.
WARN : [network] 'network-scripts' will be removed in one of the next major releases of RHEL.
WARN : [network] It is advised to switch to 'NetworkManager' instead for network management.
In AlmaLinux, it is advised to not restart NetworkManager (systemctl restart NetworkManager). The respective daemon is always running.