How do I restart Linux network service?

by admin on October 3, 2005 · 27 comments

in Tip that matters

RedHat Linux command to reload or restart network (login as root user):

# service network restart
OR
# /etc/init.d/network restart

To start Linux network service:
# service network start

To stop Linux network service:
# service network stop

Debian Linux command to reload or restart network:
# /etc/init.d/networking restart

To start Linux network service:
# /etc/init.d/networking start

To stop Linux network service:
# /etc/init.d/networking stop

Ubuntu Linux user use sudo command with above Debian Linux command:
# sudo /etc/init.d/networking restart

To start Linux network service:
# sudo /etc/init.d/networking start

To stop Linux network service:
# sudo /etc/init.d/networking stop

{ 27 comments… read them below or add one }

1 Saravanan October 4, 2005 at 4:23 am

service network start ======>to start Network under Redhat Linux
service network stop ======>to stop Network under Redhat Linux
service network restart =====> to restart Network under Redhat Linux

Reply

2 uday February 10, 2014 at 10:29 am

service network restart

Reply

3 Enrique Alvarez June 22, 2006 at 5:19 am

I have debian, and I can’t restart any service with the command
# /etc/init.d/networking restart,
please help m ewith this, I have heard about a command to do it , something like invoke-rc.d or insserv
Thanks in advance.

Reply

4 Tom Cat May 21, 2014 at 12:06 pm

maybe you only nead to restart device…
# sudo ifdown wlan0
# sudo ifup wlan0

Reply

5 nixCraft June 22, 2006 at 10:48 am

The command is:
/etc/init.d/networking restart

No need to use invoke-rc.d here. What error you are getting?

Reply

6 Doan minh duc June 23, 2006 at 3:04 pm

I’m using Knoppix 5 and I can’t restart any service with the command
# /etc/init.d/networking restart

i see the error like this:
bash:networking :command not found

Reply

7 Anonymous December 1, 2009 at 2:31 am

go into /etc/init.d and then from there run: ./networking restart

Reply

8 anonymous April 10, 2012 at 1:39 pm

thanks that worked for me :)

Reply

9 nixCraft June 23, 2006 at 7:51 pm

Doan,

I can use the command /etc/init.d/networking on Knoppix version 4.0

Use following command to restart:
# /etc/init.d/network restart

OR use GUI tool:
Click the Knoppix menu in the bottom left corner > Point to Network/Internet >
Click Network Card Configuration > You can start/stop or change network settings.

OR use network-setup GUI tool command:

# network-setup

Reply

10 Paranoid July 20, 2007 at 5:35 pm

holy crap, i did service network restart and now my box is inaccessible

Reply

11 Suja Bhattacharya May 4, 2010 at 6:42 am

Same problem with me. I want to change IP address of eth0 and after restarting the network, it is inaccessible. ifconfig is not giving any details of eth0 since its dead. How did you solve the problem?

TIA
Suja Bhattacharya

Reply

12 chris October 3, 2007 at 10:44 pm

Thanks!

Reply

13 Jason April 7, 2009 at 5:10 am

Oddly enough you can’t restart networking from the /root directory or the /etc/init.d directory..
I found that if I cd to /home THEN i run /etc/init.d/networking restart (in debian) otherwise I just get “command not found”

Reply

14 Josué May 26, 2009 at 9:08 pm

Thank you!

Reply

15 John June 26, 2009 at 4:34 pm

@Jason: Try “/./etc/init.d/networking restart”. The first / says start from the root…

@Paranoid: lol! NEVER do this command unless you can actually touch the server with your bare hands!

the redhat example works fine for me!

Reply

16 Satbir July 10, 2009 at 3:44 am

As your page helped me. Would like to thank you…

Reply

17 alpesh July 24, 2009 at 2:21 pm

I want to laurn linux redhat how to laurn plz tell me

Reply

18 Alexiei July 26, 2009 at 12:05 pm

With my backtrack 4 pre-final, I can resume only wired (eth0) network but wireless doesn’t work.
Which is the command for wireless?
Thank you

Reply

19 Linton February 6, 2010 at 3:03 pm

I’m with Paranoid. Several times my network has gone down due to power glitch or some other reason. I try the suggested:

service network restart

which does “work”. By that I mean that it shuts down eth0 and loopback and restarts loopback. Every time that this happens, I must reboot, then eth0 works again. Please tell me how to restart without rebooting. I run FC10.

Thanks!!!

Reply

20 Lukesaber May 2, 2010 at 11:54 am

Linton; sometimes things don’t always work as planned.

if a power failure or something causes you instability, invest in a ups!
also, write scripts to check if an interface is down or not. if this is a headless machine, having cron run your interface check script will save you headaches of dragging a monitor to your box.
you can use
#ping -I eth0 -c 1 192.168.1.1
where the -i eth0 is your desired interface, and 192.168.1.1 is a closest outside device, say, cable modem, etc… write a script that determines the status of your ping and to simply reconnect it if needed. tell cron to run it every 5 minutes and you’ve got a self supporting connection..

just a tip!

Reply

21 Hallff August 3, 2010 at 3:44 am

Hello Srs,

I have a problems when I use ‘service network restart’ or ‘/etc/init.d/network restart’ on *centOs 5 .

The problems is , the network do not back, I block the network and only to back when I reboot the server .

Any ideia ?

Thanks all !

Reply

22 DRAD October 8, 2011 at 10:40 am

For those who have the problem of no network after doing a restart or stop|start, the issue may be that you started your network service but have not brought up your network interface (e.g. eth0). If you do a ifconfig and only get the loopback interface (e.g. lo) then try bringing up your eth0 interface. This should enable your interface and grab an IP (assuming DHCP).
To bring the interface up you can use:
* ifconfig eth0 up (note: if your interface is not eth0 you will need to replace it with the name of your interface).
You can find all configured interfaces in /etc/network/interfaces such as:
* cat /etc/network/interfaces

Reply

23 Raghu March 12, 2012 at 5:32 am

Thank you !

Reply

24 valer88 May 29, 2012 at 9:37 am

Thanks a lot it worked!

Reply

25 Roshan August 17, 2012 at 7:56 am

Bahut achha ……….

Reply

26 abhishek September 19, 2012 at 4:24 am

my Interface is Downing once. then it not bringing up…plz help.

Reply

27 anoop November 3, 2012 at 12:38 am

it worked…i tried a lot of other options…this one was spot on….THANK YOU

Reply

Previous post:

Next post: