Zach Burlingame
Programming, Computers, and Other Notes on Technology

HOWTO: Enable Wireless Networking on Boot in Ubuntu Linux without NetworkManager

Building on my previous post, this is how to enable wireless networking on boot without NetworkManager.

I’m using WPA in this example, but the setup is similar for WEP and WPA2 using wpa_supplicant.

Remove NetworkManager (Optional)

sudo apt-get remove network-manager

Setup WPA Supplicant

To convert the WPA passphrase into the appropriate form (which is salted with the SSID), you need to use wpa_passphrase. For example:

wpa_passphrase my_ssid my_secret_password

Generates:

network={
ssid=”my_ssid”
#psk=”my_secret_password”
psk=6bea99c21cff6002adc637d93a47fba760ec5e6326cb41784c597b6691ed700d
}

Using this information, you need to setup /etc/wpa_supplicant.conf like so:

ap_scan=1
network={
ssid=”my_ssid”
#psk=”my_secret_password”
psk=6bea99c21cff6002adc637d93a47fba760ec5e6326cb41784c597b6691ed700d
}

Enable Wireless Interface

Put an entry in /etc/network/interfaces for wlan0 (or wlan1, or whatever your wireless interface is).

NOTE: I’ve put the DHCP option here for completeness, but I ran into problems with a Belkin USB F5D9050 wireless adapter not getting an IP successfully, even after it associated with the AP. I’m not sure if this was a problem with the device, the linux driver, or the AP. I ended up adding a DHCP reservation on the AP and then using a static IP configuration on the server.

Option 1: DHCP

auto wlan0
iface wlan0 inet dhcp

Option 2: Static IP

auto wlan0
iface wlan0 inet static
address 192.168.0.20
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf

Debugging

If you are having issues getting this to work, one debugging trick is to start up wpa_supplicant directly in the foreground and checking the output of dmesg and /var/log/syslog for additional details.

sudo wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd
Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *


*