Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes my wireless loses connection and will not reconnect. However, I find it will reconnect when I open terminal and run

sudo modprobe -r nameOfDriver
sudo modprobe nameOfDriver

However, going to Network Manager and un-checking enable wireless and enable wireless does not fix the problem.

Is there any way to have network manager remove the driver via modprobe? What exactly is disabling in network manager (or with the hardware/keyboard switch) do?

share|improve this question
up vote 1 down vote accepted
  • Disabling a wireless connection in Network Manager deactivates the wireless interface (similar to ifdown or ifconfig down), and then soft-blocks (turns off) the hardware device. It does not unload the wireless driver (kernel module).
  • The hardware/keyboard wireless switch will also soft-block (or hard-block, i.e. cut power) the internal wireless card.
  • You can customize -- to a limited degree -- what happens when Network Manager enables/disables an interface by editing scripts in /etc/NetworkManager/dispatcher.d; see man NetworkManager for more info.
    • BUT this cannot be used to load/unload the driver via modprobe, because once Network Manager unloads the driver, the interface ceases to exist and it won't be able to bring it back up! (notice when you modprobe -r that the Wireless options completely disappear from the drop-down menu)

So, the best option is to setup a custom keyboard shortcut to a script which unloads/loads the driver; you can add that script to the sudoers file such that no sudo is needed for it. See this question for details.

share|improve this answer

modprobe -r is removing the driver but only for the session. To do so permanently, you would need to blacklist it, but I don't remember how sorry. the wireless button/switch is meant to turn off your wifi by disabling the driver btw.

share|improve this answer
The wireless switch blocks the hardware device, it has nothing to with the kernel module. – izx Aug 22 '12 at 1:31
In fact it does, since the blocking is handled by the kernel module of the corresponding wireless adapter. – Cumulus007 Aug 22 '12 at 1:38
@Cumulus007 does it "disable the driver btw"? – izx Aug 22 '12 at 1:41
It doesn't, but your statement the wireless switch has nothing to do with the kernel module is simply not true. – Cumulus007 Aug 22 '12 at 1:42
@Cumulus007: so you are telling me that the hardware button/switch on the laptop to turn wireless on/off, which presumably works on any OS depends on the Linux kernel module? – izx Aug 22 '12 at 4:35

Your Answer


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.