Gentoo Wiki




This is a tutorial to have a Linksys WMP54G with the RaLink chipset and the rt61 driver working under Gentoo Linux. To do this I will be using the net-wireless/ralink-rt61 driver with the 2.6.21 kernel. I've noticed many people are having problems installing drivers for this particular chipset, so here is a guide to get it up and running. I've read somewhere this driver is available in kernel 2.6.24, but if you don't want to deal with the test kernel, this guide is for you.

Note: If you choose to go with the kernel driver, you still need to get the firmware from ralink

Check your chipset

As root use the command:

your_machine ~#

to make sure you have the RT2561/RT61 chipset (lspci is part of sys-apps/pciutils).


Firstly, compile wireless LAN (non hamradio) support for your kernel. See Wireless/Configuration for more information.

Driver installation

Currently the rt61 package is masked in portage. To allow installation, add the following line to /etc/portage/package.keywords:

File: /etc/portage/package.keywords

Install the rt61 driver using

emerge --ask --verbose ralink-rt61

Then load the rt61 module:

modprobe rt61

The module should then appear


In order to have the module automatically loaded at boot

echo "rt61" >> /etc/modules.autoload.d/kernel-2.6

And create net.ra0;

ln -s /etc/init.d/net.lo /etc/init.d/net.ra0

Now the interface ra0 should appear in ifconfig.

ifconfig -a

Once the module is loaded, and ready to go, you may play with iwconfig to see if it recognizes your new wireless card. If that fails, reboot the machine. This may not be the 'Gentoo Way' of doing it but it worked for me.

If this is so, then so far, so good.

Manual installation


First of all, make sure you have the correct hardware by running lspci, you should see rt61 on that list. Download the latest driver from the ralink site: In there you will find a link to the latest rt61 driver. My way of doing it is to open a rooted window and type:

Code: Download Source Code
tar -vjxf 2007_1210_RT61_Linux_STA_v1.1.2.0.tar.bz2
cd 2007_1210_RT61_Linux_STA_v1.1.2.0/Module

Compilation and Build

Once you are in the working folder read the README file if you want some background, here is what you will find in the build document:

Code: Compile Source Code
$cp Makefile.4  ./Makefile       # [kernel 2.4]
$cp Makefile.6  ./Makefile       # [kernel 2.6]
$cp Makefile.RTL865x ./Makefile  #  big endian platform
[kernel 2.4] $chmod 755 Configure
             $make config         # config build linux os version
$make all            # compile driver source code
$make install
$cp rt2561.bin /etc/Wireless/RT61STA/        # copy firmware
$cp rt2561s.bin /etc/Wireless/RT61STA/
$cp rt2661.bin /etc/Wireless/RT61STA/
$cp rt61sta.dat /etc/Wireless/RT61STA/rt61sta.dat
Warning: Make sure you have basic wireless support enabled in your kernel.

Configuration for WPA

Firstly, emerge wpa_supplicant

emerge -av wpa_supplicant

To configure for use with WPA encryption we need to edit /etc/Wireless/RT61STA/rt61sta.dat:

nano -w /etc/Wireless/RT61STA/rt61sta.dat

For this example I will be using WPA-PSK and TKIP.

File: /etc/Wireless/RT61STA/rt61sta.dat

And that's that. Having specified nothing in /etc/conf.d/net in the way of IP addresses, DHCP should be assumed.

To test whether the configuration works, if necessary firstly stop your wired connection.

/etc/init.d/net.eth0 stop

And attempt to start the wireless interface

/etc/init.d/net.ra0 start

If at this stage an IP address is gathered by DHCP, then you're good to go.

You can then add ra0 to automatically start on boot:

Code: Create symbolic link and add to default runlevel
ln -s /etc/init.d/net.lo /etc/init.d/net.ra0 
rc-update add net.ra0 default

Add the following line to /etc/conf.d/net to disable dhcp (RutilT will take care of dhcp).

File: /etc/conf.d/net

Kernel 2.6.26

This does not work for kernel 2.6.26+. For kernel 2.6.26 use the CVS nightly version. There is also a CVS daily tarball. Follow the instructions in the readme file.

Retrieved from ""

Last modified: Sat, 11 Oct 2008 10:37:00 +0000 Hits: 3,446