Ubuntu Restart Networking Command

How do I restart the networking on Ubuntu Linux system from a shell prompt?

You can easily restart, stop, or start networking service under Ubuntu Linux using a shell prompt. You can also restart networking remotely over ssh session. However, please do not stop networking service over ssh session as you will loss connectivity to the remote server. You can use the following tools:
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements None
Est. reading time 1m
How to restart network in Ubuntu Server:
  1. /etc/init.d/networking restart script based command.
  2. service restart networking – Use service to run a System V init script such as networking.
  3. systemctl restart networking – Restart networking for the latest version of Ubuntu server.

The syntax is as follows to restart the networking on Ubuntu or Debian based operating systems.

Task: Restart networking under Ubuntu Linux

Open the terminal (bash shell command line) and type the following commands on the latest version of Ubuntu 16.04 or above:
$ sudo systemctl restart networking
$ sudo systemctl restart networking.service
To verify status and connectivity, enter:
$ sudo systemctl status networking.service
$ ip r ## show routing info ##
$ ip a show eth0 ## show info for eth0 interface ##
$ ip a show br0 ## show info for br0 interface replace br0 with your actual interface ##
$ ping cyberciti.biz

Sample session from above commands:

Fig.01: How to restart network service in Ubuntu server

Note for for an older version of Ubuntu such as Ubuntu 14.04 LTS or older, enter:
$ sudo /etc/init.d/networking restart

How to restart the networking service (Ubuntu version 14.04LTS or older)?

You can use the service command following as well:
$ sudo service networking restart

Warning: Do not stop networking service over ssh session.

To start networking service, enter :

$ sudo /etc/init.d/networking start
$ sudo service networking start

To stop networking service, enter:

$ sudo /etc/init.d/networking stop
$ sudo service networking stop

A note about desktop users

If above command failed, try the following command:
$ sudo service network-manager restart
OR systemd based Ubuntu system (latest version:
$ sudo systemctl restart network-manager

See also:
  1. See how to make changes to Ubuntu Linux network configuration by editing /etc/network/interfaces file.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 6 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
6 comments… add one
  • vajorie Oct 7, 2011 @ 15:15

    Interestingly enough, this command now says it is deprecated (due to a change in Debian code[1]). I think it still works, though probably for a limited time.

    [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=565187

  • Shafiul Apr 5, 2012 @ 15:00

    I like this site , really rich collection of solutions

    i am from bangladesh , working as Project Manager

    My wish to developed myself as a High level linux administrator

    this site help me a lot daily

  • Abdul Hafeez Tahir May 5, 2014 @ 2:39

    slam i want to learn networking configuration in ubuntu using terminal

  • Ryan Feb 23, 2015 @ 13:43

    i cannot execute the “service network restart”
    it”ll display network unrecogonized service.
    And also my apache is not working well.
    after restarting apache ,apache page is not displaying after typing the localhost in my ubuntu system.
    please help me guys.
    thanks in advance.

  • vishal gaur Jun 24, 2016 @ 5:59

    such a helpfull site!!

  • george Aug 31, 2016 @ 10:08

    The correct syntax to restart network in Ubuntu Server for the second option is:
    2. service networking restart Use service to run a System V init script such as networking.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum