Page 1 of 9 123 ... LastLast
Results 1 to 10 of 88

Thread: HOWTO: RT61 on Feisty Fawn with WPA

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Beans
    10

    HOWTO: RT61 on Feisty Fawn with WPA

    These are my experiences getting a RT61-based wireless LAN (WLAN) card to work on Ubuntu Feisty Fawn (7.10) using WPA authentication. My chipset is:

    ubuntu@ubuntu:~$ lspci | grep Ra
    05:00.0 Network controller: RaLink RT2561/RT61 rev B 802.11g

    Part 1 first gets the interface working by manual tweaking, done running from the live CD in these examples to ensure a pristine environment. Explanations are given for each step so that if/when it Doesn't Work for You, the experience isn't a complete write-off. Part 2 then automates the configuration on startup.

    Why not Network Manager?

    Ubuntu 7.04's NetworkManager (found under System -> Administration -> Network, or from the gnome applet) is not able to configure WPA with the rt61 driver (see the list of NetworkManager's supported drivers), so I could not use it. Some guides I've seen recommend uninstalling it ('sudo dpkg -P network-manager network-manager-gnome'), but I found that to be unnecessary.

    Differences from Edgy

    Back with Ubuntu 6.10, I successfully followed the HOWTO: RT61 on Egdy Eft with WPA guide. With 7.04 most of this is obsolete. The ralinktech.com driver (RT61_Linux_STA_Drv1.0.4.0.tar.gz) does not even compile on my 2.6.20 kernel:

    Code:
     jturner@psyche:~/RT61_Linux_STA_Drv1.1.0.0/Module$ make
    make -C /lib/modules/2.6.20-15-generic/build SUBDIRS=/home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.20-15-generic'
      CC [M] /home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module/rtmp_main.o
    /home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module/rtmp_main.c: In function ‘RT61_probe’:
    /home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module/rtmp_main.c:197: error: ‘struct net_device’ has no member named ‘get_wireless_stats’
    /home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module/rtmp_main.c: In function ‘RT61_open’:
    /home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module/rtmp_main.c:326: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
    make[2]: *** [/home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module/rtmp_main.o] Error 1
    make[1]: *** [_module_/home/jturner/RT61_Linux_STA_Drv1.1.0.0/Module] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-15-generic'
    make: *** [all] Error 2
    jturner@psyche:~/RT61_Linux_STA_Drv1.1.0.0/Module$
    And neither do you need it, because Feisty includes the mostly-working fork(?) of it from serialmonkey.com:

    Code:
     ubuntu@ubuntu:~$ lsmod | grep rt61
    rt61 245128 1
    
    ubuntu@ubuntu:~$ modinfo rt61
    filename: /lib/modules/2.6.20-15-generic/kernel/ubuntu/wireless/rt2x00-legacy/rt61/rt61.ko
    license: GPL
    description: Ralink RT61 802.11abg WLAN Driver 1.1.0 CVS CVS
    author: http://rt2x00.serialmonkey.com
    srcversion: 180F8980D3385B365E8F654
    alias: pci:v00001814d00000401sv*sd*bc*sc*i*
    alias: pci:v00001814d00000302sv*sd*bc*sc*i*
    alias: pci:v00001814d00000301sv*sd*bc*sc*i*
    depends:
    vermagic: 2.6.20-15-generic SMP mod_unload 586
    parm: debug:Enable level: accepted values: 1 to switch debug on, 0 to switch debug off. (int)
    parm: ifname:Network device name (default ra%d) (charp)
    ubuntu@ubuntu:~$
    The old Edgy howto, and rt2x00.serialmonkey.com distribution's instructions both say to copy some bin files to /etc/Wireless/RT61STA/, and configure a rt61sta.dat file in there with wireless connection details. This worked for me in Edgy with my hand-compiled rt61 driver, but hasn't worked for me in Feisty (perhaps this was just user error). So below I haven't used them, and the configuration previously done in rt61sta.dat I now do in /etc/network/interfaces 'pre-up' sections.


    1) Manual Configuration

    After booting the live CD, or after a clean install, you will see Ubuntu has an interface for the network card already configured:

    Code:
     ubuntu@ubuntu:~$ ifconfig ra0
    ra0 Link encap:Ethernet HWaddr 00:08:A1:A3:C2:B0
    inet6 addr: fe80::208:a1ff:fea3:c2b0/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2248 errors:0 dropped:0 overruns:0 frame:0
    TX packets:9630 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:235262 (229.7 KiB) TX bytes:0 (0.0 b)
    Interrupt:16
    
    ubuntu@ubuntu:~$ iwconfig
    lo no wireless extensions.
    
    eth0 no wireless extensions.
    
    ra0 RT61 Wireless ESSID:"" Nickname:""
    Mode:Managed Frequency:2.412 GHz Bit Rate=54 Mb/s
    RTS thrff Fragment thrff
    Link Quality=0/100 Signal level:-121 dBm Noise level:-111 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0
    However, as ra0 is unconfigured (ESSID:"", etc), the network connection isn't working. We need to configure it manually. Interface configuration is done with 'ifconfig'. Wireless interfaces need additional configuration with 'iwconfig' and 'iwpriv'.


    1.1) Disable the ra0 interface

    First thing to note is that if the interface is enabled (listed in 'ifconfig' output), your iwconfig/iwpriv changes won't take effect:

    Code:
     ubuntu@ubuntu:~$ iwconfig
    lo no wireless extensions.
    
    eth0 no wireless extensions.
    
    ra0 RT61 Wireless ESSID:"" Nickname:""
    Mode:Managed Frequency:2.412 GHz Bit Rate=54 Mb/s
    RTS thrff Fragment thrff
    Link Quality=0/100 Signal level:-121 dBm Noise level:-111 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0
    
    ubuntu@ubuntu:~$ sudo iwconfig ra0 essid WHALENET
    ubuntu@ubuntu:~$ iwconfig
    lo no wireless extensions.
    
    eth0 no wireless extensions.
    
    ra0 RT61 Wireless ESSID:"" Nickname:""
    Mode:Managed Frequency:2.412 GHz Bit Rate=54 Mb/s
    RTS thrff Fragment thrff
    Link Quality=0/100 Signal level:-121 dBm Noise level:-111 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0
    
    ubuntu@ubuntu:~$
    (note no change to ESSID)

    So first bring down the ra0 interface:

    Code:
     ubuntu@ubuntu:~$ sudo ifconfig ra0 down
    ubuntu@ubuntu:~$ ifconfig
    eth0 Link encap:Ethernet HWaddr 00:16:177:AC:C1
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:17 Base address:0x6000
    
    eth0:avah Link encap:Ethernet HWaddr 00:16:177:AC:C1
    inet addr:169.254.9.63 Bcast:169.254.255.255 Mask:255.255.0.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    Interrupt:17 Base address:0x6000
    
    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:20 errors:0 dropped:0 overruns:0 frame:0
    TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1432 (1.3 KiB) TX bytes:1432 (1.3 KiB)
    
    ubuntu@ubuntu:~$
    Notice that the ra0 interface is gone.


    1.2) Configure ra0 with iwconfig and iwpriv.


    Now we want to configure the ra0 interface so it connects to the wireless network. I am using WPA with a shared key (WPA PSK), connecting to a network called WHALENET. Your essid and WPAPSK will be different (possibly other settings too, but start with those).

    Code:
     ubuntu@ubuntu:~$ sudo iwconfig ra0 essid WHALENET
    ubuntu@ubuntu:~$ sudo iwpriv ra0 set AuthMode=WPAPSK
    ubuntu@ubuntu:~$ sudo iwpriv ra0 set WPAPSK="My secret WPA key"
    ubuntu@ubuntu:~$ sudo iwpriv ra0 set EncrypType=TKIP
    ubuntu@ubuntu:~$ iwconfig
    lo no wireless extensions.
    
    eth0 no wireless extensions.
    
    ra0 RT61 Wireless ESSID:"WHALENET" Nickname:""
    Mode:Managed Frequency:2.462 GHz Access Point: 00:0F:B5:1D:C2:CE
    Bit Rate=54 Mb/s
    RTS thrff Fragment thrff
    Link Quality=85/100 Signal level:-50 dBm Noise level:-79 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0
    
    ubuntu@ubuntu:~$
    Make sure that ESSID has taken the value you set it to. If the interface is working, the 'Link Quality' should be something other than 0/100.

    Not working? Then check if the wireless network is even visible with 'iwlist scan':
    Code:
     ubuntu@ubuntu:~$ sudo iwlist scan
    lo Interface doesn't support scanning.
    
    eth0 Interface doesn't support scanning.
    
    ra0 Scan completed :
    Cell 01 - Address: 00:0F:B5:1D:C2:CE
    ESSID:"WHALENET"
    Mode:Managed
    Channel:11
    Encryption keyn
    Quality:84/100 Signal level:-53 dBm Noise level:-256 dBm
    
    ubuntu@ubuntu:~$
    You may find that other iwpriv parameters need tweaking. As a reference, you could download the rt61 driver source from serialmonkey.com. Valid parameters are listed in the Module/rt61sta.dat file. I'd recommend running 'sudo ifconfig ra0 down' before 'iwpriv', just in case the interface's up'ness prevents its reconfiguration.


    1.3) Configure ra0's IP details


    Now configure the ra0 interface's IP. I am using a static IP here (192.168.0.102, randomly picked from the my valid 192.168.0.x range):

    Code:
     ubuntu@ubuntu:~$ sudo ifconfig ra0 192.168.0.102 netmask 255.255.255.0 up
    ubuntu@ubuntu:~$ ifconfig ra0
    ra0 Link encap:Ethernet HWaddr 00:08:A1:A3:C2:B0
    inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
    inet6 addr: fe80::208:a1ff:fea3:c2b0/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:5179 errors:0 dropped:0 overruns:0 frame:0
    TX packets:12548 errors:0 dropped:0 overruns:0 carrier:0
    collisions:1 txqueuelen:1000
    RX bytes:554229 (541.2 KiB) TX bytes:3850 (3.7 KiB)
    Interrupt:16
    
    ubuntu@ubuntu:~$

    1.4) Configure routes


    At this point, my default route is still eth0 (my unused wired network card):

    Code:
     ubuntu@ubuntu:~$ route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.0.0 * 255.255.255.0 U 0 0 0 ra0
    link-local * 255.255.0.0 U 0 0 0 eth0
    default * 0.0.0.0 U 1000 0 0 eth0
    ubuntu@ubuntu:~$
    So let's delete it and add a default route to my router (192.168.0.1):

    Code:
     ubuntu@ubuntu:~$ sudo route del default
    ubuntu@ubuntu:~$ sudo route add default gw 192.168.0.1
    ubuntu@ubuntu:~$ route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.0.0 * 255.255.255.0 U 0 0 0 ra0
    link-local * 255.255.0.0 U 0 0 0 eth0
    default 192.168.0.1 0.0.0.0 UG 0 0 0 ra0
    ubuntu@ubuntu:~$
    I can now ping the router (if you can ever ping a router, congratulations, the worst is over):

    Code:
     ubuntu@ubuntu:~$ ping 192.168.0.1
    PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
    64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=9.52 ms
    64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=1.63 ms
    64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=1.59 ms
    ...

    1.5) Configure DNS

    DNS isn't yet configured:

    Code:
    ubuntu@ubuntu:~$ ping google.com
    ping: unknown host google.com
    I want my router to be the DNS server, and this is done by creating (the live CD doesn't have one) an /etc/resolv.conf:

    Code:
     ubuntu@ubuntu:~$ sudo su
    root@ubuntu:/home/ubuntu# echo "nameserver 192.168.0.1" >> /etc/resolv.conf
    root@ubuntu:/home/ubuntu# ping google.com
    PING google.com (64.233.187.99) 56(84) bytes of data.
    64 bytes from jc-in-f99.google.com (64.233.187.99): icmp_seq=1 ttl=242 time=243 ms
    64 bytes from jc-in-f99.google.com (64.233.187.99): icmp_seq=2 ttl=242 time=242 ms
    64 bytes from jc-in-f99.google.com (64.233.187.99): icmp_seq=3 ttl=242 time=243 ms

    1.6) Manual configuration: summary


    This manual configuration can be summed up by these commands:

    sudo ifconfig ra0 down # Take interface down for configuration
    ubuntu@ubuntu:~$ sudo iwconfig ra0 essid WHALENET # Set the name of the network you want to join
    ubuntu@ubuntu:~$ sudo iwpriv ra0 set AuthMode=WPAPSK # I use shared-key WPA authentication
    ubuntu@ubuntu:~$ sudo iwpriv ra0 set WPAPSK="My secret WPA key" # My shared key
    ubuntu@ubuntu:~$ sudo iwpriv ra0 set EncrypType=TKIP
    ubuntu@ubuntu:~$ sudo ifconfig ra0 192.168.0.102 netmask 255.255.255.0 up # Configure interface with IP details
    ubuntu@ubuntu:~$ sudo route del default # Delete default (eth0) route for IP traffic
    ubuntu@ubuntu:~$ sudo route add default gw 192.168.0.1 # Default route to my router


    2) Automatic configuration on startup

    We want to do all the above steps automatically when Ubuntu starts. The
    /etc/init.d/networking script will invoke 'ifup', which in turn runs the
    'ifconfig' and 'route' commands we performed manually above. ifup's
    configuration file is /etc/network/interfaces.

    So edit /etc/network/interfaces:

    Code:
    ubuntu@ubuntu:~$ sudo gedit /etc/network/interfaces
    and at the beginning, add a section like:

    Code:
     auto ra0
    iface ra0 inet static
    address 192.168.0.102
    netmask 255.255.255.0
    gateway 192.168.0.1
    pre-up iwpriv ra0 set AuthMode=WPAPSK
    pre-up iwpriv ra0 set EncrypType=TKIP
    pre-up iwconfig ra0 essid WHALENET
    pre-up iwpriv ra0 set WPAPSK="My secret WPA key"
    Run 'man interfaces' to see a detailed explanation. In short:
    • 'auto ra0' says that the ra0 interface is to be brought up automatically on system startup ('ifup -a' run from '/etc/init.d/networking start').
    • 'iface ra0 inet static' defines ra0 as a statically configured TCP/IP interface. If instead you want to use DHCP, instead specify 'iface ra0 inet dhcp' and omit the address, netmask and gateway lines
    • address, netmask and gateway is the static IP configuration for my interface.
    • the 'pre-up' commands are run before the interface is brought up. Here we configure the interface with our wireless details (step 1.2 above).

    You can test this all by running 'sudo ifdown ra0' and 'sudo ifup ra0', which is essentially what the init.d script does on startup.

    If you have any stories of success or failure, or know of an easier/better way of doing things, please let everyone know in the comments.
    Last edited by amniarix; April 25th, 2007 at 02:37 PM. Reason: Correct reason for NetworkManager not working (plus link). Thanks huygens!

  2. #2
    Join Date
    Mar 2006
    Location
    European Union
    Beans
    321
    Distro
    Ubuntu

    Wink Re: HOWTO: RT61 on Feisty Fawn with WPA

    Quote Originally Posted by amniarix View Post
    Ubuntu 7.04's NetworkManager (found under System -> Administration -> Network, or from the gnome applet) does not support WPA, so I could not use it.
    A small detail, Network Manager does support WPA and even WPA2 (I am using it with an Intel based WiFi card with WPA2, and I have been using it before with WPA).
    The problem is that the Ralinktech drivers (both the opensource rt2x00 and the rt61 that one can download from the Ralinktech web site) do not provide the necessary interface in its API to have Network Manager support WPA with this driver.
    Check NetworkManager hardware support wiki.


    But in the end you're right using Network Manager with a Ralink driver and using WPA encryption does not work

  3. #3
    Join Date
    Apr 2007
    Beans
    6
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    My interface is called ra1 by default and not ra0. I am using WPAPSK and TKIP as in the example.
    There is an open access point in the area and it tries to use it instead of my home encrypted network. I edited the instructions to be for ra1 but still it does not associate with my AP. It instead remains connected to the open AP in the area.
    With ifdown and ifup I get errors.

    I'm using a WMP54G 4.1, had it working fine in Edgy Eft, but in both Ubuntu and Kubuntu 7.04 it has been a major pain. I even tried compiling the serialmonkey CVS build in Kubuntu and it still did not work. However, I did use the dat file when I did that. I did not use the new method of pre-up.
    I was trying Kubuntu hoping its wireless managers would be of help. Unfortunately, they did not enable wpa_supplicant for rt61.

    Update: After rebooting ifconfig and iwconfig show the correct information but I still can't ping anything.
    In the boot CD it is ra0
    Update: I pulled out the kernel module that came with ubuntu and replaced it with the latest CVS build, then followed the steps of writing interfaces file. It is ra0, but unfortunately ubuntu no longer boots as it has Soft CPU Lockup 100% of the time. Time to pop in Knoppix...

    I'm afraid I'd have to do a fresh install now. I managed to remove the interfaces entry and now I can boot again, but the bleeding edge module is still installed. Maybe the older latest Beta won't crash?
    Last edited by jerathim; April 25th, 2007 at 02:42 PM. Reason: update

  4. #4
    Join Date
    Jan 2007
    Beans
    10

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    Quote Originally Posted by jerathim View Post
    Update: After rebooting ifconfig and iwconfig show the correct information but I still can't ping anything.
    If you run 'iwconfig', what does "Link Quality" say? If it's 0/100, you've not connected, and you need to 'sudo ifconfig ra0 down' and try other iwpriv settings (going by what 'sudo iwlist scan' says of your network). If the link quality is nonzero and 'ifconfig' lists the wireless interface, try getting the routing correct before investigating more exotic causes. 'route' should print something like this:

    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     *               255.255.255.0   U     0      0        0 ra0
    link-local      *               255.255.0.0     U     1000   0        0 ra0
    default         192.168.0.1     0.0.0.0         UG    0      0        0 ra0
    The contents of /var/log/messages and /var/log/kern.log might also be useful.

  5. #5
    Join Date
    Apr 2007
    Beans
    6
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    I think I'd better start fresh, I've messed with it too much.

  6. #6
    Join Date
    Apr 2007
    Beans
    1

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    Thanks a lot! It was very helpful for me!

  7. #7
    Join Date
    Feb 2007
    Beans
    28
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    works well up until 1.4

    what router are you using? i have a netgear and i think my gateway is 192.168.1.1 not 192.168.0.1
    192.168.1.1 is what i use to get to the router config in windows.

    i can follow all your steps perfectly and get the same results up to pinging the router. i get no response at either 192.168.1.1 or 0.1 and i have tried configuring w/ both default gateways.

    also, my wireless is coming up as ra1 instead of ra0...don't know if this is having anything to do with it.

    seems like i'm having the same problems as jerathim...jerathim have you gotten this to work yet? i have the same deal ra0 from the live cd and ra1 after a clean install.

  8. #8
    Join Date
    Apr 2007
    Location
    Stuttgart
    Beans
    1
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    hey!

    first of all thank you amniarix for your explanations!

    everything is working fine when I configure it manually!

    i think i made a mistake in the interface configuration but can't find it.

    my /etc/network/interfaces looks like:

    auto ra0
    iface ra0 inet static
    adress 192.168.1.77
    netmask 255.255.255.0
    gateway 192.168.1.1
    pre-up iwconfig ra0 essid hackmichdoch
    pre-up iwpriv ra0 set AuthMode=WPAPSK
    pre-up iwpriv ra0 set WPAPSK="My secret WPA key"
    pre-up iwpriv ra0 set EncrypType=AES

    auto lo
    iface lo inet loopback

    if I try "ifup ra0" it fails with error message "Don't seem to be have all variables for ra0/inet"

    Don't know what is wrong. Like I mentioned before, everything works fine manually!

  9. #9
    Join Date
    Apr 2007
    Beans
    6
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    No, I haven't had any luck yet. I just did a fresh install and haven't messed with it yet. Once again it is ra1 instead of ra0. I have to remain wired to my router until we find a way through this setback. I'm not sure the open wireless is working well, but it might just be a poor signal. I can't do the manual steps to test it because it won't accept my SSID. All I can try is the steps to configure it for startup. (I will have to make someone change their laptop settings to change the SSID on them)
    Why would it be ra1 rather than ra0 when I only have one wireless card? This time I'm not touching the module, I'm just using what came with it to test.
    How much of the logs would be helpful? I can't really read them well. I don't know what I am looking for.
    Last edited by jerathim; April 26th, 2007 at 07:19 AM.

  10. #10
    Join Date
    Jan 2007
    Beans
    10

    Re: HOWTO: RT61 on Feisty Fawn with WPA

    Quote Originally Posted by jerathim View Post
    I can't do the manual steps to test it because it won't accept my SSID.
    Have you run 'sudo ifconfig ra1 down' just before trying? My SSID wouldn't change too when the interface was 'up' (listed in ifconfig output).

Page 1 of 9 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •