Gaming industry under DDoS attack. Get DDoS protection now. Start onboarding

Products

  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

How to Troubleshoot DNS Issues: Complete Guide

Your website stops loading. Email bounces back. Users can't access your application. The culprit? A DNS failure that's invisible to most monitoring tools but devastating to your operations. When DNS breaks, every service that depends on it

DNS Servers: What They Are and How They Work

Every time you type a website address into your browser, an invisible infrastructure processes your request in milliseconds, and it's handling billions of these lookups every single day. Without this system, you'd need to memorize strings o

What is DNSSEC: Definition, How It Works & Security Benefits

Your DNS queries get hijacked. Users land on fake versions of your website. Credentials get stolen before you even know you're under attack. DNS cache poisoning and spoofing attacks exploit a fundamental vulnerability: the Domain Name Syste

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

Subscribe to our newsletter

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