Gaming industry under DDoS attack. Get DDoS protection now. Start onboarding
  1. Home
  2. Developers
  3. How to Restart the Network in Ubuntu

How to Restart the Network in Ubuntu

  • By Gcore
  • September 12, 2023
  • 2 min read
How to Restart the Network in Ubuntu

Using Ubuntu and need to restart your network? It’s a common task that might sound technical, but it’s simpler than you might think. This guide will walk you through the steps, making it easy for anyone to follow along, regardless of how tech-savvy they might be.

Using the Network Manager

Restarting the network using the Network Manager is a common method in modern Ubuntu systems. Here’s the steps below:

1.  Open the Terminal.  Press Ctrl + Alt + T together. This shortcut will open the Terminal.

2.  Check Network Status (Optional).  Before restarting, you can check the current status of your network with the following command.

nmcli general status

Sample Output:

3. Restart the Network Manager. To restart the network, use the following command below.

sudo systemctl restart NetworkManager

Enter your password when prompted. This command will restart the Network Manager service, which manages network connections on Ubuntu.

4. Verify the Restart. To ensure that the network has been restarted, you can check its status again.

nmcli general status

5. Close the Terminal. Once you’ve confirmed the network restart, you can close the Terminal.

Using ifup/ifdown Command

This is less common in newer versions of Ubuntu, but it is still available. Here are the steps below:

1. Open the Terminal. Press Ctrl + Alt + T to quickly open the terminal.

2. Identify Your Network Interface. To know which interface you wish to restart, list all available ones. Use this command.

ip a

This command displays all your network interfaces. Wired connections usually appear as ethX (like eth0) and wireless connections might look like wlpXsY (like wlp2s0).

Sample Output:

3. Restart the Network Interface. First, bring the network interface down with the ifdown command.

sudo ifdown eth0

Then, immediately bring it back up using the ifup command.

sudo ifup eth0

4. Verify the Restart. After restarting the interface, it’s wise to verify its status to ensure it’s operational. Use the ip a command again or ping a known address to test the connectivity.

ping -c 4 google.com

Please note.  Be cautious using ifup and ifdown if you’re connected to the machine remotely. Restarting the network interface can sever your connection. These commands work in conjunction with the /etc/network/interfaces configuration file. If an interface isn’t defined there, the commands might not have the desired effect.

5. Close the Terminal. After ensuring everything is working correctly, you can close the terminal by typing exit or simply closing the window.

That’s it, congratulations on expanding your Ubuntu expertise! Whether for troubleshooting or routine maintenance, you’re now better equipped to handle networking challenges. Learning the nuances of network management in Ubuntu can greatly enhance your skills as a user or administrator. By successfully navigating how to restart the network, you’ve taken an essential step in ensuring smoother system operations.

Conclusion

Want to run Ubuntu in a virtual environment? With Gcore Cloud, you can choose from Basic VM, Virtual Instances, or VPS/VDS suitable for Ubuntu:

Choose an instance

Related articles

What is DNS-over-HTTPS (DoH)?

DNS-over-HTTPS (DoH) is an internet security protocol that encrypts DNS queries by sending them over HTTPS connections on port 443, the same port used for standard HTTPS traffic. Standardized by the IETF in RFC 8484 in October 2018, DoH pre

TLS 1.3 vs TLS 1.2: what’s the difference?

TLS 1.3 vs 1.2 refers to the comparison between two versions of the Transport Layer Security protocol, a cryptographic standard that encrypts data exchanged between clients and servers to secure network communications. TLS 1.3, finalized in

What does SSL handshake failed mean?

An “SSL handshake failed” error occurs when a client and server can't complete the initial negotiation process required to establish a secure encrypted connection. This negotiation happens before any data transfer begins and typically compl

What is TLS 1.3?

TLS 1.3 is the latest version of the Transport Layer Security protocol, standardized in RFC 8446 in August 2018. This cryptographic protocol secures communication between clients and servers across the internet, from web browsing to API cal

What is DNS load balancing?

DNS load balancing is a technique that distributes incoming network traffic across multiple servers by manipulating DNS responses to improve the availability and performance of applications or services. It works at the application layer (la

What is an SSL handshake?

An SSL handshake, more accurately called a TLS handshake, is a process that establishes a secure encrypted connection between a client (like a web browser) and a server before any data transfer begins. As of 2024, over 95% of HTTPS websites

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.