How can I restart the Network Interfaces (eth0) on a Remote Linux Box?
August 11th, 2007That’s a queer Problem. I was sitting via SSH on a Remote Box and I needed to restart the network interfaces in order to change the IP Adresses:
sudo ifdown eth0 wouldn’t work because it needs to be put up again (that means a sudo ifup eth0 command). But after ifdown is executed, my connection would be lost - logically. And the box would be in Nirvana
So I asked in the Ubuntu Support Channel (#ubuntu) and they told me to use sudo /etc/init.d/networking restart - the perfect solution to my problem. Nice
Did you Like this Post? Try these ones! :)
How to find other local area network (LAN) computers in Ubuntu Linux? on September 19th, 2007
How can I define a static Network IP Address for eth0 and create a LAN Connection in Ubuntu Linux? on September 9th, 2007
How can I count the Lines of a Text File? on August 10th, 2007
How to list the Filesystems, Partition Tables and Hard Disks in Ubuntu Linux? on August 11th, 2007
How to set up NFS and How to Share Files in a local network with Ubuntu Linux? on August 31st, 2007


August 13th, 2007 at 02:08
I wonder whether that solution really works. Because the restart command is still executed on the shell you are currently connected to, it could be stopped while the network interface is about to restart, and thus cancel the ifup of that interface?
Maybe I missed something, though …
August 13th, 2007 at 02:21
It worked like a charm for me - the SSH Connection didn’t even “drop”, I stayed in connection to my Remote Box while the interfaces were restarted. Try it out!
August 13th, 2007 at 07:33
Okay that’s cool, I guess I’m a bit suspicious, because my local deskop always need a bit to bring up the interfaces again. But that could also be a result of having two ethernet cards and using DHCP instead of static IP-addresses.

I don’t have a chance to try it out soon anyways, as I don’t have a dedicated box atm.
September 3rd, 2007 at 01:09
But hell it works hangy =D
September 10th, 2007 at 04:43
[…] just restart your network interfaces and we’re done! :o) Did you Like this Post? Try these ones! :)How to set up NFS and How to […]