- Points
- 178
In AlmaLinux 8/9 and RHEL 8/9, network management is typically handled by NetworkManager, a service that manages network interfaces. Here’s how to restart the network and NetworkManager service on these systems:
Restarting NetworkManager
- Restart the NetworkManager Service:
You can restart NetworkManager to apply changes to network configurations:
Code:sudo systemctl restart NetworkManager
- Verify the Status:
To ensure NetworkManager is running correctly:
Code:sudo systemctl status NetworkManager
Reload Network Configuration
If you have made changes to network configuration files and want to reload these changes without restarting the entire service, you can use nmcli:- Reload Network Configuration:
Code:sudo nmcli connection reload
This command reloads the network connections but does not restart the NetworkManager service itself. - Restart Individual Connections:
To restart a specific network connection (e.g., eth0):
Code:sudo nmcli connection down eth0 sudo nmcli connection up eth0
Manage Network Interfaces Directly
For specific cases where you might need to bring network interfaces up or down directly, you can use ip commands or ifup/ifdown commands.- Bring Interface Down:
Code:sudo ip link set dev eth0 down
- Bring Interface Up:
Code:sudo ip link set dev eth0 up
Replace eth0 with the actual name of your network interface.
Apply Configuration Changes
If you modify configuration files directly (e.g., in /etc/sysconfig/network-scripts/), restarting the NetworkManager service or reloading connections will apply these changes.Example: Applying Network Configuration Changes
Suppose you have edited the configuration file for a network interface located at /etc/sysconfig/network-scripts/ifcfg-eth0. To apply these changes:- Restart NetworkManager:
Code:sudo systemctl restart NetworkManager
- Verify Configuration:
Check the status of your network interfaces to ensure changes are applied:
Code:ip a