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

Multi-Cloud Plan: What It Is and How It Works

Your cloud provider goes down. Applications fail. Customers can't access your services. And because you've built everything around a single vendor, there's nothing you can do but wait. For organizations locked into one cloud platform, this

Vendor Lock-In in Cloud Computing: What It Is and How to Avoid It

Imagine discovering that migrating your company's data to a new cloud provider will cost hundreds of thousands of dollars in egress fees alone, before you've even touched the re-engineering work. Or worse, picture being in Synapse Financial

What is Transcoding: Definition, Process & Benefits

You're watching a video on your phone during your commute when it suddenly buffers, pixelates, and freezes, despite having full bars. Meanwhile, your friend streams the same content flawlessly on their laptop at home. Behind the scenes, str

What Is Sovereign Cloud and Why Does It Matter?

Picture this: a foreign government issues a legal order forcing your cloud provider to hand over sensitive patient records, classified research data, or critical national infrastructure details. You can't stop it. This isn't hypothetical. G

SQL Injection Prevention: Complete Security Guide & Best Practices

Your database gets compromised. Customer records disappear. Credit card data ends up for sale on the dark web. SQL injection attacks remain one of the most prevalent web application vulnerabilities in 2024, consistently appearing in top ten

What is Rate Limiting: Definition, Types & Implementation Guide

Your login page just got hammered with 10,000 password attempts in under a minute. Your API servers are buckling under a flood of requests. Legitimate users can't access the service while infrastructure costs spike. Without proper controls,

Subscribe to our newsletter

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