How to Restart the Network on CentOS Stream 9

How to Restart the Network on CentOS Stream 9

Keeping your network running smoothly is essential for Linux admins and system engineers. In CentOS Stream 9, managing network connections requires the right tools, and sometimes a restart is necessary. This guide walks you through multiple ways to restart network services and troubleshoot issues effectively. By the end, you’ll have a clear and professional approach to handling network restarts.

Why Restarting the Network is Important

Before jumping into the steps, it’s helpful to understand when and why you might need to restart the network in CentOS Stream 9.

  • Applying New Network Configurations: Changes in IP address, DNS, or other settings require a network restart to take effect.
  • Fixing Connectivity Issues: Restarting can resolve issues like dropped connections, unreachable hosts, or misconfigured interfaces.
  • Reloading Network Services: When installing new tools or making security updates, restarting the network ensures updated services are running properly.

CentOS Stream 9 uses the NetworkManager service for network management, making network task automation simpler but slightly different from legacy CentOS versions.

Now, let’s explore how you can restart the network, step by step.

Restart the Network Using NetworkManager

The default method for managing networks in CentOS Stream 9 is through NetworkManager, CentOS’s network configuration service. Here’s how to use it effectively.

Step 1: Check the NetworkManager Status

To ensure NetworkManager is running, check its status with the following command:

systemctl status NetworkManager

This displays whether the service is active and running. If it’s inactive, start it with:

sudo systemctl start NetworkManager

 nmcli device status - Restart the Network on CentOS Stream 9 -

Step 2: Restart the Network Service

Once NetworkManager is running, restart the network service using:

sudo systemctl restart NetworkManager

This command reinitializes all configured network interfaces and applies any changes made to the configurations.

Step 3: Verify Connections

After restarting, confirm your network connections are working as expected with:

nmcli device status

This command shows the state of network interfaces, allowing you to troubleshoot if anything’s offline.

Restart the Network Using nmcli (Command-Line Tool)

nmcli is a command-line utility that works hand-in-hand with NetworkManager to manage network connections. Unlike restarting the entire NetworkManager service, nmcli gives more granular control over individual connections.

Step 1: View Available Connections

List all current connections:

nmcli connection show

This displays your active and inactive connections, along with their names and UUIDs.

Step 2: Restart the Connection

Use the following command to bring down and then bring up a specific connection:

nmcli connection down <connection_name>

nmcli connection up <connection_name>

Replace <connection_name> with the name from the previous command. This restarts only the targeted connection.

Step 3: Check the Connection Status

After restarting, verify that the connection is active:

nmcli connection show –active

Active connections are displayed in this list along with their respective details.

Restart the Network with ifdown and ifup

For traditional Linux users who prefer a more manual approach, ifdown and ifup commands still work for managing network interfaces.

Step 1: Identify the Network Interface

First, identify the interface you want to restart using:

ip addr

You’ll see a list of interfaces (e.g., eth0, ens33, etc.).

Step 2: Restart the Interface

Run the following commands to bring the interface down and then up:

sudo ifdown <interface_name>

sudo ifup <interface_name>


Replace <interface_name> with the interface you need to restart.

⚠️ Note: These commands require the network-scripts package, which may not be installed by default in CentOS Stream 9. You can install it using:

sudo yum install network-scripts

Troubleshooting Network Restart Issues

Here are some common issues and how to resolve them if restarting the network doesn’t work as expected.

1. NetworkManager Not Running

If NetworkManager isn’t running, you can start it with:

sudo systemctl start NetworkManager

To make sure it starts automatically after a reboot, run:

sudo systemctl enable NetworkManager

2. Failed Interface Configuration

If a specific interface isn’t coming up, check the configuration file in /etc/sysconfig/network-scripts/ or /etc/NetworkManager/system-connections/. Ensure all settings such as IP address and DNS are correctly defined.

Test the configuration directly with:

nmcli connection reload

3. DNS Issues

If websites aren’t resolving after a restart, your DNS settings might be the issue. Verify DNS configuration in /etc/resolv.conf and update it as needed.

Additionally, troubleshoot with:

nslookup www.google.com

4. Firewall Restrictions

A misconfigured firewall could block network traffic, even after restarting. Use the firewalld tool to confirm:

sudo firewall-cmd –list-all

Allow necessary services or ports, if needed.

Tips for Best Practices

  • Always test changes in a non-production environment before applying them live.
  • Consider using backup configurations to avoid downtime if something goes wrong.
  • Familiarize yourself with CentOS Stream updates, as network scripts and tools may evolve in newer versions.

Deploy Seamless Network Management with Confidence

Like other modern distributions of Linux, restarting the network on CentOS Stream 9 can be done with either NetworkManager, nmcli, or old-style tools. This is a basic skill that every administrator must learn. Troubleshooting connectivity problems, updating configurations, or enhancing network performance are all possible with the help of this guide—and you can do it with ease.

Get hands-on with these techniques and maintain smooth network operations for your CentOS system. If you’re looking for more advanced tutorials or updates on CentOS Stream tools, keep following our blog for expert insights tailored to Linux professionals like you.

FAQs: Restarting the Network on CentOS Stream 9

1. When should I restart the network on CentOS Stream 9?

You should restart the network after changing IP configurations, updating DNS settings, troubleshooting connectivity issues, or applying security updates.

2. What’s the best way to restart the network in CentOS Stream 9?

The recommended way is using systemctl restart NetworkManager since CentOS Stream 9 relies on NetworkManager for handling connections.

3. Will restarting the network disconnect active SSH sessions?

Yes, restarting the network may drop your SSH connection. If you’re working remotely, consider using nmcli connection reload to apply changes without losing access.

4. How is NetworkManager different from older networking services?

Unlike traditional network.service used in older CentOS versions, NetworkManager provides better automation, dynamic configuration, and easier management for modern network setups.

5. What if my network doesn’t come back after a restart?

Check your configuration files (/etc/sysconfig/network-scripts/ or nmcli connection show), ensure the correct network interface is enabled, and review logs using journalctl -xe -u NetworkManager.

6. Can I restart a specific network interface instead of the entire network?

Yes, you can restart a single interface using nmcli connection down <interface> followed by nmcli connection up <interface>.

7. Does restarting the network affect running containers or virtual machines?

It depends on how networking is configured. If they rely on the host’s network stack, they may experience temporary disconnections.

8. Is there a non-disruptive way to apply network changes?

Instead of a full restart, try nmcli connection reload or ip link set <interface> down && ip link set <interface> up to minimize downtime.