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.

Is there a way to specifically control which networking interfaces are brought online automatically by NetworkManager when I login? I have two wifi cards, one of which doesn't work, and I need to be able to specify "Don't automatically bring up wlan0" so that my wifi works and is stable.

Right now, I disable the interface by doing sudo ifconfig wlan0 down to manually bring down the interface after login, but I'd like to not have to do that step.


The system this is primarily going to be used on is a Precise (12.04) system, but I would also like this to work with later versions as well.

share|improve this question
    
Why not blacklist the driver for wlan0? –  chili555 Jul 22 '13 at 0:55
    
@chili555 because at times I may need to use that interface and it needs to be readily available in the event the other one won't work for the network(s) I use. Which happens sometimes because of MAC address restrictions. –  Thomas W. Jul 22 '13 at 0:57
add comment

1 Answer 1

Please do:

gksudo gedit /etc/rc.local

Right above exit 0 add the following:

ifconfig wlan0 down

Proofread carefully, save and close gedit. Now the computer will boot with wlan0 down. If you later need to use it, take down wlan1 and bring up wlan0:

sudo ifconfig wlan1 down
sudo ifconfig wlan0 up
share|improve this answer
    
facepalm I forgot all about /etc/rc.local. But I've tried a similar thing, using a TTY before logging in and doing sudo ifconfig wlan0 down but after I logged in, the network interface was back up, because Network Manager (part of the GUI) brought it back up on its own. I'm not sure the method here will work, based on my tests. I'll test this at next reboot though, and we'll see if this answer works or not. (You still get an upvote!) –  Thomas W. Jul 22 '13 at 1:08
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.