Restarting the network is often necessary for implementing new settings, or for fixing minor networking issues. There are multiple ways to do this on Ubuntu.
The steps can differ depending on which backend you’re using for network configuration. But there are universal methods to restart the network as well, regardless of the daemon in use.
Restart Network Graphically
Ubuntu desktops use the
NetworkManager daemon by default for network configuration. You can access the NetworkManager applet from the system tray to easily reset your connection.
- Click on the top-right panel and turn off your connection.
- Click there again and turn the connection back on.
Alternatively, you can also restart the network from the control center.
- Search and open the Settings app.
- Go to the Network (Ethernet) or WiFi tab and toggle the connection off-on.
We reset a specific connection earlier, but you can also deactivate and reactivate all interfaces managed by NetworkManager like so
sudo nmcli networking off
sudo nmcli networking on
Alternatively, you can also restart
NetworkManager.service using systemctl.
sudo systemctl restart NetworkManager
Restart networkd Service
The networking daemon choice is mostly a matter of preference. NetworkManager is more popular with Ubuntu users these days, but networkd is still commonly used on servers. If you’re using networkd, you can restart your network like so
sudo systemctl restart systemd-networkd
Restart Interface with ip Command
You can set the administrative state of a device to down and up with the
ip utility. The exact resulting behavior depends on the network driver, but typically, this leads to the driver reloading.
This method isn’t useful for applying config changes. But if you’re just trying to restart a specific interface, you can check the interface name with
ip link show
And you can set the interface state to down and up like so
sudo ip link set enp42s0 down && sudo ip link set enp42s0 up