I always need to ifdown/ifup wlan0 after reboot
Have you tried one of the solutions below? I have to guess the answer here as the problem is not easy to reproduce, may be an issue with the driver you got.
In the interfaces file try commenting out "auto wlan0" and just keep "allow-hotplug wlan0"
#auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp ... rest of the config ...
Probably not the ideal solution you are looking for but try creating a new shell script with execute privileges in your favourite scripts directory with the following content.
ifdown wlan0 ifup wlan0
Then add the following line to your interfaces file.
auto wlan0 iface wlan0 inet dhcp ... rest of the config ... post-up /path-to-your-script/script.sh
When your computer starts up without the wireless connection active. Try fiddling with
iwconfig
with different parameters (try man iwconfig to get a complete list) until your interface comes up. I guess may betxpower
sort of switch might help you out here. If that works for you, then usepre-up <command-that-worked>
in your interfaces file like in the 2nd answer and leave the command there.So something like this at the end (remember to pass absolute paths to (pre|post)-up
pre-up /sbin/iwconfig wlan0 txpower on
Exactly same problem here. The problem was a timing issue: wlan0 wasn't ready when the boot process issued the ifup
.
I solved this by adding a wait statement pre-up sleep 5
to wlan0 in the interfaces file:
marcelo@breeze:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
pre-up sleep 5
address 10.0.0.42
netmask 255.255.255.0
gateway 10.0.0.2
dns-nameservers 10.0.0.2
wpa-ssid mycoolssid
wpa-psk returnguantanamo