keepcalculator

06 Numbers and Powers

Restart Network Interface in RHEL (Full Guide)

Card No. 06·40336 · Updated · Standard formula, shown below

To restart a network interface in RHEL, use the nmcli command (e.g., sudo nmcli connection down ens3 && sudo nmcli connection up ens3) or the older ifdown/ifup commands for immediate changes. This article covers the different methods, when to use each, and how to troubleshoot common issues.

Background: How RHEL Manages Network Interfaces

Red Hat Enterprise Linux (RHEL) has evolved its network management over the years. Modern RHEL versions (7 and later) use NetworkManager as the default service that handles network interfaces, connections, and devices. NetworkManager provides a unified interface via the nmcli command-line tool, the nmtui text-based UI, and the GNOME graphical settings.

Older RHEL 6 and earlier used the network service and configuration files in /etc/sysconfig/network-scripts/. While those files still exist in RHEL 7-9 for compatibility, NetworkManager is the primary way to manage networking. Understanding this distinction helps you choose the right command for your system.

How to Restart a Network Interface with nmcli

The most reliable and recommended method is using nmcli. First, list your connections and devices:

  1. Run nmcli device status to see all network devices (e.g., ens3, eth0, wlan0) and their state.
  2. Run nmcli connection show to see the configured connection profiles (e.g., System ens3).
  3. To restart a specific connection, use sudo nmcli connection down followed by sudo nmcli connection up .

For example, to restart the connection named System ens3:

sudo nmcli connection down "System ens3"
sudo nmcli connection up "System ens3"

This brings the interface down and then up, re-applying the configuration. If you only want to restart a device (not a connection), use sudo nmcli device disconnect ens3 and then sudo nmcli device connect ens3.

Using ifdown/ifup for Legacy Systems

On RHEL 6 and earlier, or if you have the legacy network scripts installed, you can use:

sudo ifdown eth0
sudo ifup eth0

These commands read the configuration files in /etc/sysconfig/network-scripts/ (e.g., ifcfg-eth0). They are still available on RHEL 7-9 if you install the network-scripts package, but they are deprecated and not recommended for new deployments.

Restarting the Entire Network Service

Sometimes you need to restart all network interfaces at once, for example after making changes to multiple configuration files. You can restart the NetworkManager service:

sudo systemctl restart NetworkManager

This will bring down and up all interfaces managed by NetworkManager. On older systems, use sudo service network restart or sudo systemctl restart network (if the legacy service is enabled). Be cautious: this will cause a brief network outage, which may drop your SSH session.

How to Choose the Right Method

  • For a single interface with NetworkManager: Use nmcli connection down/up – it only affects that connection.
  • For a single interface on legacy systems: Use ifdown/ifup.
  • For all interfaces or after major config changes: Restart the NetworkManager service with systemctl restart NetworkManager.
  • For a temporary change without persistence: Use nmcli device disconnect/connect – this does not re-read configuration files.

Common Problems and Troubleshooting

If the interface fails to come up after a restart, check the following:

  • Configuration errors: Run nmcli connection show to verify the IP settings, gateway, and DNS.
  • Hardware issues: Check dmesg | grep -i eth or journalctl -u NetworkManager for driver or link errors.
  • Firewall or SELinux: These rarely block a restart, but if the interface comes up but no traffic flows, check firewall-cmd --list-all and getenforce.
  • Duplicate connections: If you have multiple connection profiles for the same device, NetworkManager may pick the wrong one. Use nmcli connection show and delete unused profiles.

A common misconception is that running systemctl restart network is the same as restarting NetworkManager. On RHEL 7-9, the network service is a wrapper that may not exist by default. Always prefer NetworkManager unless you have a specific reason.

Frequently Asked Questions

Will restarting a network interface drop my SSH connection?

Yes, if you are connected over that interface. To avoid being locked out, use a scheduled command (e.g., at) or ensure you have out-of-band access (like IPMI). Alternatively, use nmcli device reapply ens3 which tries to apply changes without bringing the interface down.

What is the difference between a device and a connection in NetworkManager?

A device is the physical or virtual hardware (e.g., ens3). A connection is a configuration profile (e.g., System ens3) that defines how the device should be set up (IP, DNS, etc.). A device can have multiple connections, but only one active at a time.

How do I restart a network interface without root?

You cannot. Bringing interfaces down/up requires root privileges. You can ask your administrator to grant you sudo rights for specific commands via sudoers.

What does nmcli connection reload do?

It re-reads the connection configuration files from disk without changing the current state of active connections. It is useful after manually editing files in /etc/sysconfig/network-scripts/.

Why does my interface have a different name (ens3 vs eth0)?

RHEL 7+ uses predictable network interface names based on firmware/PCI location. ens3 means it’s on PCI slot 3. You can override this with kernel parameters, but it’s not recommended.

Can I restart a network interface using the GUI?

Yes, in GNOME, go to Settings → Network, click the gear icon next to your interface, and toggle the connection off and on. This is equivalent to nmcli connection down/up.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →