Many times my network adapter just stops working, the only option is to reboot anyway.Is there a way to reset network adapter in a session so I won't have to reboot my computer many times?
2 Answers
There is an answer that may work for you:
If you really want to reset the network adapter you usually need to unload and reload the kernel module that it uses.
If you just want to reconfigure it you can usually do:
sudo /etc/init.d/network-manager restart
But if you just want a new dhcp lease (that's the technical name for obtain a new IP from the router), you just need to use:
sudo dhclient -v eth1
Source: https://askubuntu.com/questions/54710/how-do-i-reset-the-network-adapter-using-a-terminal-command
-
-
@personinsack can you check this thread : ubuntuforums.org/archive/index.php/t-913407.html last message from a member named "desconocido".– mtilhanSep 29, 2015 at 12:46
I use this command and it works just fine for me:
sudo service network-manager restart
I use it to restart wifi whenever it stops working (it was much more of an issue after new release of Ubuntu/Xubuntu 16.04, in Loki it's much more stable for me so I use it very little, usually after many suspends).
-
-
probably.. I no longer have such issues on any machine, so i can't help to test it..– jenaMar 15 at 18:00
-
It's been a while since I upgraded my personal laptop, so if it was fixed or improved, I don't have that improvement. The command I posted is what I used. Three times today (maybe it's time to upgrade). Mar 16 at 0:40
-
some improvements are expected after 6 years since the answer was posted, but the issue may as well depend on hardware, drivers, and such.. my current slimbook laptop came with elementary OS preinstalled, so probably I should have few such issues to begin with.. I recommend posting a new question with details of your system, if you want some help with it (you can link this page in your question)..– jenaMar 17 at 10:28
-
One wonders what the appropriate commands are for Elementary OS 7 (Horus). Neither
service network-manager restart
(ancientinit.d
method) norsystemctl restart network-manager
(under modernsystemd
) exist any longer. There is a unit calledNetworkManager
, but restarting it won't produce any significative changes — I believe it only affects the network icon on the top bar. Jun 8 at 21:57
lshw -c network
if you need help with this.