Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I am using Ubuntu, sometimes the network goes down and there is no option to bring back the wired network. There is always option for wireless, but no option for wired network. In such case I try sudo service network-manager restart (using a command line just to start the interface). This works sometimes, sometimes it takes many iterations and other times it never starts. In my country the network goes down without any reason. I even wrote a perl script to run above script for at least 10 iterations and scheduled it using Cron. Since lately I cannot start the network using above command unless I restart the computer. What is the problem with the computer, why can't a network restart become a first class citizen in Ubuntu and needs a computer reboot. Why isn't there an option that never goes down just like wireless network to start wired network. Is there something I am missing. The command sudo /etc/init.d/networking restart does not seem to do anything at all.

share|improve this question

4 Answers 4

You can run this command to take down all interfaces:

sudo ifdown -a

Then run this to bring them back up again:

sudo ifup -a

Hope that helps!

See also:

share|improve this answer

The "Wired network" option in the NetworkManager indicator becomes greyed out if no connection is detected over the cable. First of all I would check that you are not using a faulty cable or router.

If it really is a problem with the driver or network hardware on your computer, you might want to try unloading and reloading the kernel module responsible for handling your wired network adaptor. You can find the name of the module by running lspci -k, looking for the entry corresponding to your network card, and reading the name off the line "Kernel driver in use". Then do sudo rmmod <name> ; sleep 5 ; sudo modprobe <name>, replacing <name> with the name of the kernel module in question. The network hardware should be re-initialized in the process, so the effect should be pretty close to a reboot.

share|improve this answer
    
Pretty powerful, thanks! :) –  Earendil Nov 7 '13 at 14:19

In Xubuntu, which might differ from Ubuntu, I can deactivate the network as a whole in the Panel (but not just Eth).

Your problem doesn't sound like normal behaviour, so there is no normal way to deal with it.

Another solution, which might trigger a restart, would be to pull the cable and plug it again.

Investigating your lookfiles might help you to find out, what is going on, and what to fix. Try

dmesg | tail -n 30 

on the next time your connection drops.

Another idea is, to unload the module for your network chip, and reload it again, like so.

sudo rmmod 8139too
sudo modprobe 8139too

but instead of 8139too, you have to find out what your card/chip is, and which module it uses.

share|improve this answer

A combination of the string in the question 'sudo service network-manager restart' and the suggestion in Jorge's answer 'sudo ifdown -a' followed by 'sudo ifup -a' works for me.
It may take two or three attempts, and the system sometimes requires one to two minutes to 'rediscover' the (MTS MBlaze - ZTE) modem.
Still I can live with the delay. It's far superior to shutting down all programs and restarting Ubuntu.
Thank you to all.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.