I tried to use

sudo service networking restart


sudo /etc/init.d/network restart

but they both crash the window manager and I can no longer use my keyboard for input into X.

when I use the /etc/init.d/ method it complains saying that I should use the service utility

e.g. service networking restart

but it crashes just the same.

Is there a GUI method of restarting networking?

  • Note that you might reanimate your keyboard, if you unplug and replug it - and it is hot pluggable, i.e. USB. Commented Dec 19, 2012 at 20:02
  • I also faced similar issue on Gnome 3 on Ubuntu 13.03. Screen disorted as top bar gone. Short keys not worked. As no menu/Activies shown I get no way to operate the system. Luckily console was opened already. So reboot command can be typed. Commented Jul 22, 2013 at 10:48
  • 2
    if you are looking for GUI method just open dash, type "Network" and select that. now press "On/Off" button to turn off and again click to on. your networking is restarted now. Commented Sep 1, 2014 at 18:28

18 Answers 18


For Desktops


sudo service network-manager restart

Or on recent Ubuntu versions:

sudo systemctl restart systemd-networkd


Ubuntu uses network-manager instead of the traditional Linux networking model. so you should restart the network-manager service instead of the network service. Or use ifup/down.

For Servers

Check this answer.

  • 10
    hmm, strange that restarting just networking breaks the system. Does it happen to you too or is it just me?
    – waspinator
    Commented Dec 19, 2012 at 21:25
  • 5
    @waspinator - it happens to me too. (FYI.)
    – Josh M.
    Commented Dec 29, 2013 at 3:31
  • 2
    I wish I had tried Jorge's answer first.
    – Jonathan
    Commented May 2, 2017 at 15:26
  • 12
    As of 18.04.2 the answer is: systemctl restart systemd-networkd
    – Ejoso
    Commented Feb 22, 2019 at 2:41
  • 2
    As of 2024.01 the answer for Ubuntu is systemctl restart NetworkManager.
    – dxvargas
    Commented Jan 12 at 8:43

For Servers

Restarting networking on a desktop machine will cause dbus and a bunch of service to stop and never be started again, usually leading to the whole system being unusable.

As Ubuntu does event based network bring up, there quite simply isn't a way to undo it all and redo it all, so a restart just isn't plain possible. The recommended way instead is to use ifdown and ifup on the interfaces you actually want to reconfigure:

sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a

You could try

ifconfig eth0 down && ifconfig eth0 up

(or whatever your network interface is called) to restart the network.

  • 3
    ... as far as I know, this doesn't update the interface's config according to /etc/network/interfaces ... which you might want
    – moritz
    Commented Mar 22, 2015 at 11:24
  • 1
    When using sudo: sudo ifconfig eth0 down && sudo ifconfig eth0 up. Otherwise if you are connected over ssh, you will have to reboot machine.
    – tarkeshwar
    Commented Apr 23, 2015 at 11:06
  • after trying ifup/ifdown and the reg service networking call, this finally worked for me
    – Jon B
    Commented Nov 9, 2015 at 4:15
  • I think it's better than the accepted answer because ifup doesn't handle bonded interfaces correctly, while ifconfig does
    – gilad905
    Commented Jun 5, 2018 at 12:49

ubuntu CLI: to restart the network service either

sudo /etc/init.d/networking restart


ifdown eth0
ifup eth0
  • 3
    This used to work for older kernels. Now it seems that do not work indeed. Prefered ifconfig eth0 down & ifconfig eth0 up
    – josircg
    Commented Apr 3, 2017 at 12:00
  • 1
    Beware not to use this command when connecting on remote machine. Commented Jun 26, 2017 at 9:05

For ubuntu server 18.04, this works :

sudo systemctl restart systemd-networkd
  • 5
    To new LTS 20.04 the comand above work, thanks!
    – LandiLeite
    Commented Jul 30, 2020 at 3:43
  • I confirm! This works on 20.04! Thanks! Commented Aug 26, 2021 at 19:18
  • Why oh why do they change the name every year. Sigh. That works on 20.04. Commented Dec 20, 2021 at 12:41
  • Confirm this works on Ubuntu 22.04 and 24.04 also
    – reddot
    Commented May 3 at 12:50

These days the most direct way to restart network services is to use systemd controls, namely the commandline systemd control utility systemctl. This command will restart the NetworkManager:

sudo systemctl restart NetworkManager.service

More information can be found here.

  • 2
    Try "systemctl restart networking.service" on server 16.04. Commented Oct 30, 2016 at 5:45
  • 1
    Don't need the ".service" part at the end. Commented Oct 24, 2018 at 17:34

service network-manager restart doesn't work:

stop: Unknown job network-manager
start: Unknown job network-manager

The only thing that works is:

ifconfig eth0 down
ifconfig eth0 up
sudo service network-manager restart


sudo service networking restart

Doesn't work on Ubuntu server 14.04


sudo ifdown eth0:0
sudo ifup eth0:0

Works. Change eth0:0 to your interface.


Try using the indicator (top menu bar) to disable and then enable networking.


I've got the same issue. Its a known bug https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1102507

Using service network-manager restart works through

  • This is solution which works always on 16.04. In my experience Ubuntu 16.04 have issues to restart Wi-Fi after returning from hibernation.
    – danijelc
    Commented Feb 4, 2017 at 15:19

If you can restart the network using the applet of NetworkManager, you do not need to restart NetworkManager itself (at least, most of the time).

In that case to restart all the connections, use this code from a shell or in a script:

nmcli nm enable false
sleep 5
nmcli nm enable true 

Details can be found in the NetworkManagar command-line interface manual page.

Notice that these commands acts as the applet, so they do not need any additional privilege (no sudo or whatever).


I do not really think there's GUI method - by default at least.

I'm also not sure what do You mean by 'restarting networking service', but I feel that the following could help.

Before Ubuntu 16.04

sudo killall NetworkManager 

It kills NetworkManger which automatically restarts after this. It doesn't break the system.

Ubuntu 16.04

sudo killall NetworkManager && sudo NetworkManager

Based on my personal experience, it seems that in Ubuntu 16.04 NetworkManager does not always restart by itself and it's better to start it manually.

  • How is this better than sudo service network-manager restart and why?
    – Underverse
    Commented Feb 4, 2017 at 11:33
  • 2
    @Underverse, I believe that sudo service network-manager restart just didn't work for me when posting this answer.
    – kcpr
    Commented Feb 5, 2017 at 19:27

In ubuntu 14.04 they have a new "feature" that makes it impossible to restart. Force the interface down and up works.

  sudo ip link set eth0 down
  sudo ip link set eth0 up
  • 1
    This does not restart the network services, that is, no retry for DHCP addresses etc.
    – Samveen
    Commented Aug 1, 2014 at 19:01

if ubuntu 14.04 Desktop or Server, you can restart you network by:

sudo -i
( ifdown $(ifquery --list -X lo|xargs echo) && ifup $(ifquery --list -X lo|xargs echo) )&
  • I get a ifdown: interface eth0 not configured RTNETLINK answers: File exists Failed to bring up eth0.
    – wolfgang
    Commented Sep 22, 2015 at 15:58

I am able to restart the network service on ubuntu with command.

 sudo systemctl restart network-manager

This uses Ubuntu's network-manager to disable, then enable eth0:

nmcli nm enable false eth0 && nmcli nm enable true eth0

If your connection has a different name, use it. You can learn your connections name by using the command:

nmcli c status

rmano's answer is brilliant. Solves so many issues.

Remark to improve: In U15 I experience a different syntax for nmcli:

For analysis do:

nmcli networking connectivity

To stop service do:

nmcli networking off

and to restart do:

nmcli networking on

No sudo required. Thanks rmano!


An alternative approach for the server (as of Ubuntu 18.04):

  1. Install ifupdown2 package : apt install ifupdown2

  2. Use service networking restart command

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .