Saturday, February 26, 2011

Ubuntu 10.10 with RaLink RT2561/RT61 pci wifi

I installed a new installation of Ubuntu server 10.10 today, and had to spend two hours getting my wireless card to work. As I had to scour half the internet for tips before I finally had a working configuration, I'll share my findings here to prevent head-aches for other people.

Card: RaLink RT2561/RT61 pci wifi (802.11g) card (D-link DWL-G510)
Ubuntu 10.10 server x86 running 2.6.35-25-generic-pae kernel
Connection will be setup through WPA2 to a normal access point (with DHCP)

For the rest of this guide: text marked in bold red are commands, blue text is output.

First of all, make sure you're system is updated, the issue you're now reading *could* already be fixed:
   apt-get update
  apt-get dist-upgrade
(upgrading is not supposed to break your system, but it might.. be forewarned)
note: of course you already need a working internet connection for this and the next step. I did this temporarily by setting up my windows machine with wired Internet Connection sharing.

Next you need to install support for wireless devices, and the wpasupplicant package.
  apt-get install wireless-tools wpasupplicant

Reboot computer to effectuate new drivers.

Just for checking, running 'lspci' or 'iwconfig' should show you your wireless:
  lspci  | grep RT
  05:04.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
  lo        no wireless extensions.
  eth0      no wireless extensions.
  wlan0     IEEE 802.11bg  ESSID:off/any
            Mode:Managed  Frequency:2.462 GHz  Access Point: Not-Associated
            Tx-Power=9 dBm
            Retry  long limit:7   RTS thr:off   Fragment thr:off
            Encryption key:off
            Power Management:off

Now we need to tell the wireless where you want to connect to, so we need to edit the network configuration.
    pico /etc/network/interfaces
locate the wlan0 part, and make sure it looks like this afterwards:
auto wlan0
iface wlan0 inet dhcp
     wireless-ssid Breestraat collective
     pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
     post-down killall -q wpa_supplicant

The 'Breestraat collective' is the network ssid I connect to, you should change that to your own network's name/ssid what you are trying to connect to.
(save in pico with ctrl-o, exit when done with ctrl-x)

Now we create the configuration for wpasupplicant which handles our wpa encryption.
    pico /etc/wpa_supplicant.conf
make sure it looks like the following when you save and exit:
        ssid="Breestraat collective"
        pairwise=CCMP TKIP
        group=CCMP TKIP
Be sure to again change the ssid, and enter your network key at the PSK line.

Now to test our configuration:
    if-up wlan0
if it was already on or such, you can completely reinitialize networking with:
    /etc/init.d/networking restart

Cross your fingers, and you should see your adapter coming up now.
Signal strength still seems very low in my case (lots more then windows) and there seem to have been more people using this adapter with the same issue. Regrettably with low signal you usually are just aimlessly trying to beg for a dhcp package to arrive....

Last tip: in some cases your default route will be to your internal network card (usually eth0). Testing wireless connections works a lot better if you disable your internal nic so you know for sure your trying to reach through the correct network. Then later you can reconfigure your routing to correct this.
To disable eth0
   if-down eth0
And to reenable
   if-up eth0

No comments:

Post a Comment