In the realm of Linux system administration, network connectivity stands as the lifeblood of digital communication. Whether you are managing a server, configuring a router, or simply using a desktop computer, the stability and functionality of your network services are paramount. However, like all complex systems, network services can encounter issues that require troubleshooting and maintenance. One of the most effective ways to address network-related problems is by restarting the network services.

This article delves into the essential knowledge and practical techniques required to restart network services on a Linux-based system. From understanding the role of network services to exploring different methods for restarting them, we will guide you through the intricacies of this critical system maintenance task. Whether you are a seasoned Linux administrator or a curious enthusiast, this guide will equip you with the skills to ensure seamless network connectivity and troubleshoot network-related issues efficiently. So, let’s embark on this journey to master the art of restarting network services in Linux.

Using the service Command to Restart Networking Services

The service command serves as a prominent utility for overseeing system services, encompassing those linked to network operations. This command offers an alternative to systemctl, particularly in the context of aging Linux distributions or systems not utilizing systemd. In the event of needing to initiate the restart of a network service, the command is executed as follows:

# service network restart

However, if a system is using NetworkManager as its primary network service, then the command would be:

# service NetworkManager restart

For best practices, always check the specific service name your distribution uses before attempting a restart.

Reviving Network Services with the ip link Command

The ip link command provides a granular approach by offering direct control over network interfaces. Before diving in, it’s prudent to first identify available network interfaces using:

# ip a

Once familiar with the specific interface (e.g., eth0, wlan0), the subsequent commands can help manage its state:

To disable an interface:

# ip link set [interface_name] down

To enable it again:

# ip link set [interface_name] up

Remember to replace [interface_name] with the actual name of the network interface in question.

Managing Networking with nmcli Command

The nmcli command offers a robust command-line utility for NetworkManager, making it pivotal in various networking scenarios. While it doesn’t provide a direct restart function, it facilitates a two-step approach:

First, to disable networking:

$ nmcli networking off

Then, to re-enable it:

$ nmcli networking on

This sequence effectively simulates a network restart.

Engaging with NetworkManager-TUI: A Terminal-Based Network Manager

NetworkManager-TUI, often denoted as nmtui, delivers a text user interface for network configurations, making it an indispensable tool for systems without a graphical interface. 

Here’s a step-by-step guide:

Initiate the nmtui interface with:

# nmtui

Utilize your arrow keys for navigation, selecting the option “Activate a connection” and confirming your choice with the Enter key.

Once you’ve identified the active connection you wish to handle, proceed as follows:

  1. For deactivation, employ the tab key to cycle through options until “Deactivate” is highlighted, and then finalize the action by pressing Enter;
  2. To reactivate, follow a similar process by using the tab key to locate “Activate” and then validate your selection with the Enter key;
  3. If your objective is to exit the interface, employ the tab key to navigate over “Back” and subsequently “Quit,” thus confirming and saving your modifications.

This approach offers an intuitive means of network connection management directly within the terminal, proving particularly advantageous in environments devoid of a graphical user interface.

Restarting a Networking Service on Linux via the Graphical User Interface (GUI)

Over the course of its evolution, Linux has undergone remarkable enhancements to its graphical user interface (GUI), thereby augmenting its overall user-friendliness. This transformation isn’t confined to a single version; instead, it has transcended across a diverse array of distributions, encompassing Debian, RHEL/Fedora, and Arch Linux among others. These distributions have adeptly amalgamated the command-line interface (CLI) and GUI, catering to a wide spectrum of users.

Workplace with headphones and laptop

For those who lean towards a more visually intuitive approach or may not possess an extensive familiarity with the CLI, the GUI presents a straightforward avenue to oversee a myriad of services, including the intricate task of managing the networking service. The method for restarting the networking service remains standardized across these distributions, guaranteeing a seamless user experience for everyone.

In the following comprehensive guide, we will delve into the intricate process of effortlessly rebooting the networking service through the GUI:

  • Access System Settings: Begin by launching the system settings from the main menu or the system tray. This is usually represented by a gear or wrench icon, though the exact representation might vary based on the specific Linux distribution and the desktop environment in use;
  • Locate the Network Settings: Once inside the system settings, look for an option labeled ‘Network’ or ‘Networks’. This is the hub where all networking-related settings and connections are managed;
  • View Current Connections: Upon entering the network settings, the screen should display all active and previously connected networks. This includes Wi-Fi, Ethernet, VPN, and more. It provides a snapshot of which networks the system is currently connected to and the status of each connection;
  • Reinitiating Network Services: Next to each currently active connection, you’ll find a convenient toggle switch. To initiate the restart of the networking service for a specific connection, simply switch this button to the ‘Off’ position and then back to ‘On’. This action triggers a rejuvenation of the connection, essentially rebooting the networking service dedicated to that particular network. For a thorough revitalization, it is recommended to carry out this procedure for all your active connections;
  • Verification: Once restarted, it’s a good practice to ensure that the connection is stable. This can be done by browsing a few websites or checking the connection status within the network settings. If any issues persist, additional troubleshooting steps might be required.

Conclusion

To ensure the proper operation of the network, it is imperative to initiate a restart of networking services whenever any adjustments or configurations related to the network are needed. This crucial step aids in the seamless application of network-related changes. A repertoire of commands stands at your disposal for this purpose, encompassing systemctl, service, ip link, nmcli, and nmtui. Nonetheless, for a more user-friendly approach, one may also employ the graphical user interface (GUI) method to accomplish the task of restarting networking services. This comprehensive post is geared towards acquainting you with all these commands and the GUI technique, elucidating the process of restarting the network manager across various iterations of the Linux operating system.