How to successfully restart a network without reboot? [duplicate]
Solution 1:
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:
- How to restart the networking service?
Solution 2:
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.