Ive discovered a common issue that causes when you are running net.lo with a wlan interface, in my case ralink card rt2870 with rt3070sta.ko driver, to say everytime i run the net.lo script "network is down" for set essid, mode, etc. This is caused because the set_mode function brings down the interface before set the mode, and with my driver this is not possible and fails.... when this first stage fails, then it does not bring it up again and cant continue any further with the interface down... I think this function should try both, with the interface up, and with the interface down.... Reproducible: Always
Confirmed here with a different Ralink-based adapter. Adding more info to make this easier for others to find. My adapter is a Powerlink PL-18N USB network adapter. alexis ~ # uname -a Linux alexis 2.6.39-gentoo-r3 #14 SMP PREEMPT Thu Nov 10 23:15:50 EST 2011 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 5400+ AuthenticAMD GNU/Linux Driver: rt2870sta With the interface up: alexis linux # ifconfig wlan0 up alexis linux # iwconfig wlan0 essid any alexis linux # With the interface down: alexis linux # ifconfig wlan0 down alexis linux # iwconfig wlan0 essid any Error for wireless request "Set ESSID" (8B1A) : SET failed on device wlan0 ; Network is down. alexis linux # The above makes the net.wlan0 script fail. The problem is the line in /lib/rc/net/iwconfig.sh, in iwconfig_set_mode() that says: # Devicescape stack requires the interface to be down _down Removing the _down line fixes the problem for me. My previous adapter didn't require this change, so I don't know what the "right" behaviour is.
What modes is your device being switched between? A device should be: - UP to change ESSID - DOWN to change MODE I don't think the problem is iwconfig_set_mode, because it runs: _down ; iwconfig ... mode ... ; _up
No response from user in 18 months.