Bringing eth1 (wireless network card) up/down on Ubuntu

by jenny on 20 December 2007 - 02:38pm in

For reasons that elude me, the normal way of handling this does not work for wireless interfaces:

sudo ifdown eth1
sudo ifup eth1
sudo dhclient

...but this does work:

sudo ifconfig eth1 down
sudo ifconfig eth1 up
sudo dhclient

Thanks to Lih for figuring this one out...

Wireless configuration data

The ifdown/ifup scripts in ubuntu have issues with resetting all of the iwconfig wireless configuration data. For example, if there's an encryption key set in the wireless configuration that was in memory, and no encryption key in the configuration file, ifdown/ifup still leaves the encryption key enabled. Ditto for power/sensitivity levels. What's probably going on is that ifdown is unsetting some iwconfig variables but not others, and ifup is not resetting those the way they were.

ifconfig isn't at all wireless aware, so it just tells the adapter to sever its link the same way that it would tell a wired adapter. Thus, when you bring the interface back up, the same wireless settings are still applied.

Hope this helps. Some time I'm planning to dig through the wireless configuration logic in ifdown/ifup, but due to the common availability of workarounds, it's low on my priority list (and I'm in no way affiliated with Ubuntu, I just like to make things work better).

Cheers,
Erek Dyskant
http://erek.blumenthals.com/blog/

Ah-ha

Ahh... thanks for the explanation, that does help. There are some things that I'll spend hours tracking down just to understand better how they work. Networking issues are not one of them. I tend to prod at them with a 10-foot pole and then leave well enough alone when they do start working. ;)