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 global server load balancing (GSLB)?

Global server load balancing is a traffic management system that distributes user requests across servers in multiple geographic locations to improve performance and reliability. This approach can reduce latency by 40-60% compared to single

Edge Functions: How They Work, Benefits, and Use Cases

When you're building a web application, there's a good chance you've faced this problem: your server sits in one location, but your users are scattered across the globe. That means someone in Tokyo waits longer for a response than someone i

What Is CDN SSL? How It Works, Benefits, and Setup

Most websites today use HTTPS. In fact, 68% of the top million websites have made the switch. But if you're using a CDN to speed up content delivery, SSL/TLS encryption works differently than you might expect. Your origin server isn't handl

What Is Health Check Monitoring? Benefits and Best Practices

Health check monitoring is a systematic process that tracks the availability and performance of your servers, applications, and infrastructure by sending automated requests at regular intervals. Most systems run checks every 30 to 60 second

What is GSLB and why is it important for global applications?

GSLB (Global Server Load Balancing) is a load balancing service that distributes client requests across multiple geographically dispersed data centers to improve performance, availability, and compliance.At its core, GSLB works at the DNS l

Serverless vs Containers: Key Differences, Use Cases, and Costs

Building modern applications means making a fundamental choice: serverless or containers?This decision affects how you use code, manage resources, and pay for infrastructure. Here's what you need to know.Serverless computing lets you write

Subscribe to our newsletter

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