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.

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
add comment

2 Answers 2

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
add comment

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
add comment

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.