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:
And neither do you need it, because Feisty includes the mostly-working fork(?) of it from serialmonkey.com: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$
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.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:~$
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:
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'.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
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:
(note no change to ESSID)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:~$
So first bring down the ra0 interface:
Notice that the ra0 interface is gone.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:~$
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).
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.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:~$
Not working? Then check if the wireless network is even visible with 'iwlist scan':
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.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:~$
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):
So let's delete it and add a default route to my router (192.168.0.1):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:~$
I can now ping the router (if you can ever ping a router, congratulations, the worst is over):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:~$
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:
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:~$ ping google.com ping: unknown host google.com
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:
and at the beginning, add a section like:Code:ubuntu@ubuntu:~$ sudo gedit /etc/network/interfaces
Run 'man interfaces' to see a detailed explanation. In short: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"
- '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.



Adv Reply



Bookmarks