≡ Menu

Ubuntu Linux Restart Network Service

I am a new Ubuntu Linux user and using it on my HP Laptop. Now, I need to restart my network service. How do I restart network under Ubuntu Linux? How can I restart networking service on Ubuntu LTS server? How do I successfully restart a network service without rebooting Ubuntu box?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion time1m
Ubuntu Linux comes with a script called networking (Ubuntu restart network command). This script is used to activates or deactivates or restart all network interfaces (NIC) configured to start at boot time.

Ubuntu Linux restart network command

Open shell or terminal and type the command as follows:
$ sudo /etc/init.d/networking restart
You can also use the following command:
$ sudo service networking restart
Sample outputs:

 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                           * Disconnecting iSCSI targets
   ...done.
 * Stopping iSCSI initiator service
   ...done.
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
 * Disconnecting iSCSI targets
   ...done.
 * Stopping iSCSI initiator service
   ...done.
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
 * Starting iSCSI initiator service iscsid
   ...done.
 * Setting up iSCSI targets
   ...done.
ssh stop/waiting
ssh start/running, process 45886
resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
 * Setting up iSCSI targets
   ...done.
ssh stop/waiting
ssh start/running, process 45946

You can use this command on remote Ubuntu Linux server without any problem, but make sure you pass only restart option. This command also accepts start and stop options:

WARNING! These examples may stop remote networking service if executed. Always, use restart option over ssh session.

The start and stop option

To start or stop service:
$ sudo /etc/init.d/networking start
$ sudo /etc/init.d/networking stop

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 13 comments… add one }

  • bayyou February 27, 2008, 1:59 am

    Thanks for the tips, i already tried on my ubuntu ultimate 1.4 and working good. Thank you

  • Jezz May 12, 2008, 7:29 pm

    Thanks for this tip it helped me loads. I am really grateful to people like yourself who bother to give up your time to help us newbies out. :)

  • Filype March 6, 2009, 12:31 am

    Thanks a lot for the tip, it helped me heaps!!

  • syafiq March 17, 2009, 3:56 am

    how to restart option over ssh?

  • Milind July 29, 2009, 1:57 pm

    Ok, that works. But my network is not automatically started on reboot. I have to do it manually every time. How do I start it automatically every time I boot in the system.

  • Nasaboy February 8, 2010, 4:29 am

    Milind, I had the same problem and tracked it down to: https://bugs.launchpad.net/ubuntu/+source/wpasupplicant/+bug/114310

    The solution, for me, was to follow the workaround instructions on their page and modify the “/etc/rc.local” file to include the line “sh /etc/init.d/networking restart” just before “exit 0″.

    Hope that helps.

  • m1k3y3 April 4, 2012, 7:47 pm

    I get the following message:

    * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces

    Is there any alternative to do the same remotely ?

  • Manyobvo October 23, 2012, 4:04 pm

    #sudo service networking {restart/stop/start}

  • anonymoud December 18, 2012, 8:39 pm

    haha, stopt networking via ssh. ten minues i had to realize there can’t be any chance of a ping :D

  • amir May 18, 2014, 1:41 pm

    not correct at all.

    • Bob July 5, 2014, 10:50 am

      Ubuntu 14.04 does not recognize any commands on this page. Only way I could stop networking services was telinit 0 … or unplug the ethernet cable.

      • Bob July 5, 2014, 10:51 am

        I shoudl have written “respond” rather than “recognize”.

  • deepak senapati January 10, 2015, 1:50 pm

    my computer restart automatically when using internet and media player .

Leave a Comment