Sunday, November 27, 2011

Debian Net Install - Setting WPA wireless from the command line.

WPA_SUPPLICANT is a pain in the ass.


I highly recommend the net install CD over the various other packaged versions of Debian; mainly because it gives you the freedom to customize your OS exactly how you want it.

I have ran into some problems with the pre-packaged Debian CDs. For example the Debian default Gnome CD#1 does not include a network manager such as Gnomes Network Manager or Wicd. This is extremely frustrating, without an internet connection your distro is limited to the existing packages you have on CD.

Make sure you download an "unofficial" NETINST CD from the Debian site. This ensures you have the restricted firmware, if necessary, rather than having to download it later from another computer. They are from the official Debian site, but the conviently package all the non-free firmware. Its nice to have a pure libre OS, but at the end of the day I am not going out to buy another $50 network adapter.

Unofficial CD Images (w/ Non-Free Firmware)

Start:
I assume you can follow the installation instructions. The NETINST CD is pretty simple to follow along with. Once you have installed your system, restart your computer and log in.

Non-Free Firmware Check:
First, check if you need any non-free firmware. Type the following:
ifconfig wlan0 up

 If nothing happens you do not need non-free firmware. If you see "SIOCIFFLAGS: Operation not permitted", then you will need non-free firmware.

Install Firmware:
List all your hardware, you can grep for keywords such as wireless or wifi to help narrow it down.
sudo lspci 

Insert your Debian NETINST CD. Update aptitude and search for the various firmware available. If you see your vendor, install it:
sudo aptitude update
sudo aptitude search firmware
sudo aptitude install firmware-ralink

Confirm that the firmware installed correctly. ifconfig should return without an error message
ifconfig wlan0 up

Set-up aWPA Wireless Connection:
Download the necessary tools and install them from the NETINST CD.
aptitude install wpasupplicant wirelesstools

After you will need to set your essid if your network is hidden. (Otherwise you can skip this step)
sudo iwconfig wlan0 essid myNetworkName

WPA requires a special generated key based upon your essid (Network Name) and your network password.
sudo wpa_passphrase myNetworkName myNetworkPassword | sudo tee /etc/wpa_supplicant.conf

Start wpa_supplicant in the background
sudo wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf &

Ensure that a DHCP reolv.conf file exists:
sudo touch /etc/resolv.conf

Set-up your connection for DHCP
dhclient wlan0

Test to ensure that you have a network connection.
ping google.com

Customizing your System:
Enter vi and edit /etc/apt/sources.list and ensure that all online repositories are no longer commented out (remove the #). Then you can start customizing your new net install, exactly how you want.

All the Debian repositories you could ever want and WPA_SUPPLICANT is no longer a pain in your ass.

1 comment:

Anonymous said...

Thanks, I hope that can avoid the pain LOL

Post a Comment