Fedora Core 4 rt2570 HowTo

Fedora Core 4 HowTo for RT2570 USB stick
by Martin A. Bøgelund (mostly based on work by others; see below)

This HowTo is based on the 'Mandrake 10 rt2570 Howto' by John Halfpenny, and RaLink 2400 Wireless LAN Card - 'Fedora Core 3 Installation' by Thomas Price, and some trial-and-error configuration. This HowTo is basically a copy-paste-merge of these 2 other HowTos (credits go to their authors), and only a basic documentation on how I got my system to work.

A good source for knowledge on this subject has been the RT2x00Wiki page, and the sourceforge page for the rt2x00 project.
A big Thank You! to all the involved parties for providing code and info!

My system is an ordinary x86 desktop PC with a 2GHz Celeron processor, Running FC4, kernel 2.6.11-1.1369_FC4. I'm running Gnome...
My Wireless device is an Asus WL-167g USB dongle (with the rt2570 chipset).

I also use WEP encryption and MAC filtering, and I don't broadcast my ESSID. I know of the security flaws of WEP, but 1) I can't get WPA to work, and 2) My neighbors setup is wide open, so they'll probably crack him before me ;-)

Installation

Open a terminal and log in as root

        # su - root
        password 
Download the nightly tarball and extract to /usr/src
        # cd /usr/src
        # wget http://rt2x00.serialmonkey.com/rt2570-cvs-daily.tar.gz
        # tar zvxf rtxxxxx.tar.gz
Make sure you have the kernel source in /usr/src
       # rpm -qa | grep kernel
        kernel-devel-2.6.11-1.1369_FC4
        kernel-2.6.11-1.1369_FC4
If you don't then you can install it from CD or find rpm's through the Fedora Core projects main page. Compile the module
        # cd /usr/src/rtxxxxx/Module
        # make
        ...
        # make install
        ...
        
Now the module will have probably been placed in /lib/modules/(kernelversion)
custom/extra, this is wrong and you can't modprobe if you leave it there, so 
we need to move it to /lib/modules/(kernelversion)/kernel/drivers/net/wireless/
        # cp /lib/modules/(kernelversion)/custom/extra/rt2570.ko \
        /lib/modules/(kernelversion)/kernel/drivers/net/wireless/
        # insmod /lib/modules/(kernelversion)/kernel/drivers/net/wireless/rt2570.ko
        # depmod -a

The depmod -a is necessary after you've juggled around modules, as far as I understand.
Since everybody seems to be rebooting at this stage, I did too, and I therefore advice you to do it also. If you don't reboot at this point, you probably know why...

Open up another root terminal when the PC comes back up. Type this to make 
sure the module is loaded ok, if no error is returned then it looks like we're 
ok.
        # modprobe rt2570

Configuration

Launch Desktop > System Settings > Network

Add 'DNS' as appropriate

Add 'Hosts' as appropriate. Note: you will need to include:

127.0.0.1 localhost.localdomain localhost to the hosts (this entry will not be visible)



In 'Devices' add the rausb0 device



Edit the rausb0 device



Including 'General' and 'Wireless Settings' as appropriate



Set the MAC address, possibly by probing, if you use MAC address filtering on your access point:



Add '0.0.0.0' '0.0.0.0' '192.168.1.1' (default route) to the 'Route' tab.



'Save' and exit.

Verify and customize configuration files

The file '/etc/sysconfig/network' should contain:

        NETWORKING=yes
        HOSTNAME=localhost.localdomain
        NOZEROCONF=yes	<---ensure this entry exists

The files:

'/etc/sysconfig/networking/devices/ifcfg-rausb0' '/etc/sysconfig/networking/profiles/default/ifcfg-rausb0' '/etc/sysconfig/network-scripts/ifcfg-rausb0'
(Note that these 3 files are actually hard-inked in FC4; change any one of them, and you change all 3.)
should contain:

        IPV6INIT=no
        ONBOOT=yes
        USERCTL=no
        PEERDNS=yes
        TYPE=Wireless
        DEVICE=rausb0
        BOOTPROTO=dhcp
        NETMASK=255.255.255.0
        IPADDR=
        DOMAIN=
        DHCP_HOSTNAME=
        HWADDR=11:22:33:44:55:66
        ESSID=YourCoolSSID
        CHANNEL=1
        MODE=Managed
        RATE=Auto
        GATEWAY=192.168.1.1

Most of these variables values can be directly identified in the GUI configuration tool. For example, the

        HWADDR=11:22:33:44:55:66
is the MAC address of my wireless device, and is used when MAC-filtering is performed at your access point.

I had some trouble with the RATE: Every time I started my wireless device, I was warned that 'Mb/s' was not recognized. I looked into one of the ifcfg-rausb0 files and saw that the variable RATE had this as a substring:

        RATE='11 Mb/s'
I changed this value to
        RATE=Auto
and the messages disappeared. If you feel left alone in the darkness about which values these variables might take, you can take a look at the file /etc/sysconfig/network-scripts/ifup-wireless, look for this section:
        #   Configure wireless network device options. See iwconfig(8) for more info.
        #   Valid variables:
        #   MODE: Ad-Hoc, Managed, etc.
        #   ESSID: Name of the wireless network
        #   NWID: Name of this machine on the network.  Hostname is default
        #   FREQ: Frequency to operate on.  See CHANNEL
        #   CHANNEL: Numbered frequency to operate on.  See FREQ
        #   SENS: Sensitivity threshold for packet rejection.
        #   RATE: Transfer rate.  Usually one of Auto, 11, 5, 2, or 1.
        #   KEY: Encryption key for WEP.
        #   RTS: Explicit RTS handshake.  Usually not specified (auto)
        #   FRAG: Fragmentation threshold to split packets. Usually not specified.
        #   SPYIPS: List of IP addresses to "spy" on for link performance stats.
        #   IWCONFIG: Extra parameters to pass directly to IWCONFIG
        #   SECURITYMODE: Security mode, e.g: 'open' or 'restricted'
        #   IWPRIV: Extra parameters to pass directly to IWPRIV
And of course, there are the man pages.

Now you should be able to select the rausb0 device in the network configuration tool, click 'Activate' and see your wireless device come up after a minute or two.
Enjoy!

The WPA thing...

In the beginning of this document, I told you that I couldn't get WPA to work.
Here's how I plan to make it work:
Looking at the man-page for iwpriv, I see that I can make my wireless USB device tell me which 'private' commands and settings I can pass to it, by simply issuing the command /sbin/iwpriv rausb0:

        # /sbin/iwpriv rausb0
        rausb0    Available private ioctls :
                  auth            (8BE2) : set   1 int   & get   0
                  enc             (8BE4) : set   1 int   & get   0
                  wpapsk          (8BE5) : set  64 char  & get   0
                  psm             (8BE6) : set   1 int   & get   0
The wpapsk probably stands for WPA Pre-shared key, so I actually have the opportunity to pass a WPA key on to my wireless device.
Now, I saw earlier in the file /etc/sysconfig/network-scripts/ifup-wireless that I can set a variable to pass values on to iwpriv:
         #   IWPRIV: Extra parameters to pass directly to IWPRIV
So setting
         IWPRIV=wpapsk "YourCoolPreSharedKey"
or similar would probably do the trick.