Benjamin Flesch = definitely rocks.”> How can I restart the Network Interfaces (eth0) on a Remote Linux Box (you are sitting on via SSH)? ~ mybeNi websecurity, web security and hack stuff.

web securitymybeNi websecurity

How can I restart the Network Interfaces (eth0) on a Remote Linux Box?

August 11th, 2007

That’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 :-)




5 Responses to “How can I restart the Network Interfaces (eth0) on a Remote Linux Box?”:

  1. hangy Says:

    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 …


  2. beNi Says:

    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! :)


  3. hangy Says:

    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. :(


  4. beNi Says:

    But hell it works hangy =D


  5. How can I define a static Network IP Address for eth0 and create LAN (Local Area Network) Connection in Ubuntu Linux? How to set up my Internet Gateway? ~ mybeNi websecurity, web security and hack stuff. Says:

    […] 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 […]


Leave a Reply


Google Traffic (7 days)

250
200
150
100
50
134
217
217
196
190
190
196
38.107.191.104