LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Setting wlan0 up as default. (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/setting-wlan0-up-as-default-747428/)

JakeyHards 08-13-2009 09:40 PM

Setting wlan0 up as default.
 
Whenever I reboot my system, the wlan0 automatically goes down, requiring me to:

Code:

#ifconfig wlan0 up

#dhcpcd wlan0

after startup every time.

It's not fatal or anything, just somewhat of an inconvenience. My question is if there is a way to reboot and maintain the wireless status as up?

propofol 08-14-2009 01:13 AM

If you have a Debian based distro you could try adding this to /etc/network/interfaces:

Code:

auto wlan0
iface wlan0 inet dhcp
# Static IP
#iface wlan0 inet static
#address 192.168.1.10
#netmask 255.255.255.0
#broadcast 192.168.2.255
#network 192.168.1.0
#gateway 192.168.1.1
pre-up ifconfig wlan0 up
pre-up iwconfig wlan0 mode managed
#pre-up iwconfig wlan0 essid "WLANNAME_HERE"
pre-up iwpriv wlan0 set PSMode=FAST_PSP
pre-up iwpriv wlan0 set NetworkType=Infra
pre-up iwpriv wlan0 set AuthMode=WPA2PSK
pre-up iwpriv wlan0 set EncrypType=AES
pre-up iwpriv wlan0 set SSID="WLANNAME_HERE"
pre-up iwpriv wlan0 set WPAPSK="my_wifi_password"


For some reason I could not get it to work for me. Eventually I added the following to /etc/rc.local:

Code:

/sbin/ifconfig eth0 down
/bin/sleep 1

/sbin/ifconfig wlan0 up
/bin/sleep 2

/sbin/iwconfig wlan0 mode managed
/sbin/iwpriv wlan0 set PSMode=FAST_PSP
/sbin/iwpriv wlan0 set NetworkType=Infra
/sbin/iwpriv wlan0 set AuthMode=WPA2PSK
/sbin/iwpriv wlan0 set EncrypType=AES
/sbin/iwpriv wlan0 set SSID="WLANNAME_HERE"
/sbin/iwpriv wlan0 set WPAPSK="my_wifi_password"

/bin/sleep 1
#  DHCP
/sbin/dhclient wlan0
#  Static IP
#/sbin/ifconfig wlan0 192.168.1.10 up
#/sbin/route add default gateway 192.168.1.1

Regards,
Stefan


All times are GMT -5. The time now is 10:06 AM.