Got wireless network running on Ubuntu 9.10 Server, it was even easier than I thought. Here's a small how-to:
Biggest problem was to find a proper wireless adapter. I didn't want deal with `ndiswrapper` or compile any drivers manually, so I had to find something supported by kernel that would work out of the box. Nice place to start from is wireless.kernel.org. Considering driver information there and stuff that is currently available in stores I've finally got an USB-dongle with Atheros chip, namely A-LINK WL54USB.
System I am running is Ubuntu 9.10 Server, minimal install plus OpenSSH. So the first step is to plug in the WiFi stick and check if that is recognized. And -- nothing interesting here, it just works without any setup.
Secondly, wireless interface needs to be configured. If static address is to be used, add the following to `/etc/network/interfaces`:
iface wlan0 inet static
Instead, if you plan to use DHCP with wireless interface, use this:
iface wlan0 inet dhcp
Basic setup completed. Restart networking and test it with some unsecured network:
sudo /etc/init.d/networking restart
# Check if interface is configured properly
sudo ifconfig wlan0
# Search for available networks
sudo iwlist wlan0 scan
# Connect to network
sudo iwconfig wlan0 essid "MyUnsecuredNetworkId"
And now the most interesting part -- getting wireless adapter working with WPA (WPA2 with TKIP/AES in my case). WPA supplicant is nice (if not only) tool to use, and luckily it is already installed by default. If this in not your case, you can install it by clicking here.
There is nice tutorial for ArchLinux, have a look at it first.
It would be a good idea to encode network SSID and password at once, so that WPA supplicant won't do it any time it would connect to a network. In order not to store the password in shell history, run `wpa_passphrase` without the 'password'-argument. You will then be prompted for password:
Then, create a proper `wpa_supplicant.conf` file from output of previous command. Common practice is to use `/etc/wpa_supplicant.conf`, but I prefer keeping it in `/etc/wpa_supplicant/wpa_supplicant.conf`:
#psk="your secret passphrase"
Another good idea is to protect WPA supplicant configuration file from being read by anyone except root user:
sudo chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf
Now it is time to test if it's working:
wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
If `nl80211` driver is not working by some reason, try generic `wext` instead:
wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
If everything goes fine, stop WPA supplicant with Ctrl+С and modify the interface configuration in `/etc/network/interfaces`:
# your DHCP or static IP conf described above
Restart networking or reboot, and secure wireless connection should be established automagically.