Wireless Networking Configuration

Introduction

The following guidance might be found useful in helping to configure Wireless Networking on a Linux server.

General wireless networking is described in http://en.wikipedia.org/wiki/Wireless_networking, with more specific Wifi references in http://en.wikipedia.org/wiki/Wi-Fi.

General Setup

Preparation

During this process of investigating, installing and configuring a USB Wireless Adaptor a number of kernel commands are of great assistance.

Take the tarball from the installation CD or download from site and copy to a location where it can be uncompressed and compiled, as follows:

cd /usr/local/src
wget http://www.ralinktech.com/drivers/Linux/RT73_Linux_STA_Drv1.0.3.6.tar.gz
tar xvf RT73_Linux_STA_Drv1.0.3.6.tar.gz
cd RT73_Linux_STA_Drv1.0.3.6
cd Module

Build and install the driver (for a 2.6 kernel)

cp -v Makefile.6 ./Makefile 
make all

After the build is finished, copy new module to kernel tree:

sudo cp -v rt73.ko /lib/modules/`uname -r`/kernel/drivers/usb/net/
sudo cp -v rt73.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/
sudo mkdir -pv /etc/Wireless/RT73STA
sudo cp -v rt73.bin /etc/Wireless/RT73STA/
dos2unix rt73sta.dat
sudo cp -v rt73sta.dat /etc/Wireless/RT73STA/rt73sta.dat

Insert the rt73.ko Loadable Kernel Module (LKM) produced as follows.

$ sudo insmod /lib/modules/`uname -r`/kernel/drivers/net/wireless/rt73.ko
$ sudo insmod /lib/modules/`uname -r`/kernel/drivers/usb/net/rt73.ko

Update modules.dep:

$ sudo depmod -a

Check the system status

Use system commands such as dmesg, lsusb and lsmod to check the system status after the installation of the rt73.ko module.

Install the firmware

Copy the RT73 firmware that shipped in the driver tarball to the appropriate location:

cp rt73.bin /lib/firmware

Copy the rt73sta.dat file from the Module directory to this location:

cp rt73sta.dat /etc/Wireless/RT73STA

Update the module configuration file to include the wireless USB device. Use vi /etc/modprobe.conf to add the line:

alias rausb0 rt73

Finally ...

As belt and braces copy the iw* binaries from /sbin to /usr/local/sbin which allows the executables to be picked up by the current $PATH variable definition.

My Wireless Card Configuration

I finally resorted to using static IPs entered in the ifcfg-rausb0 (and ifcfg-eth0) files due to difficulties bringing up both interfaces after the USB dongle was attached. Alongwith the IPs the NETMASK, BROADCAST addres and GATEWAY were also defined. Even then the ESSID is not being retrieved although the encryption is operating correctly.

Thus after experimentation I arrived at the following /etc/sysconfig/network-scripts/ifcfg-rausb0 configuration file:

DEVICE=rausb0
BOOTPROTO=static
HWADDR=
ONBOOT=yes
TYPE=Wireless
IPADDR=192.168.xx.xx
NETMASK=255.255.255.0
BROADCAST=192.168.xx.255
GATEWAY=192.168.xx.1
DHCP_HOSTNAME=
DOMAIN=
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ESSID='myWAP'
CHANNEL=7
MODE=Managed
RATE=Auto

Similarly for the Ethernet interface card I settle on the following /etc/sysconfig/network-scripts/keys-rausb0 configuration file:

KEY=s:aabbccddeeffgghh0099887766

Similarly for the Ethernet interface card I settle on the following /etc/sysconfig/network-scripts/ifcfg-eth0 configuration file:

DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
TYPE=Ethernet
# IPADDR=192.168.xx.xx
# NETMASK=255.255.255.0
# BROADCAST=192.168.xx.255
# GATEWAY=192.168.xx.1

Troubleshooting

By using the following commands the configuration of the interface cards can be checked. Details as shown:

ifconfig command

$ /sbin/ifconfig -a
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:192.168.xxx.xxx  Bcast:192.168.xxx.255  Mask:255.255.255.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14410112 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15142381 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1499142619 (1.3 GiB)  TX bytes:3891314591 (3.6 GiB)
          Interrupt:11 Base address:0xec80

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:112881 errors:0 dropped:0 overruns:0 frame:0
          TX packets:112881 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:33280772 (31.7 MiB)  TX bytes:33280772 (31.7 MiB)

rausb0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:192.168.xxx.xxx  Bcast:192.168.xxx.255  Mask:255.255.255.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:839747 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4431063 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:50481226 (48.1 MiB)  TX bytes:389933720 (371.8 MiB)

sit0      Link encap:IPv6-in-IPv4
          NOARP  MTU:1480  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:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
$

iwconfig command

$ /usr/local/sbin/iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

rausb0    RT73 WLAN  ESSID:""
          Mode:Auto  Frequency=1 MHz  Bit Rate=54 Mb/s
          RTS thr:off   Fragment thr:off
          Encryption key:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
          Link Quality=0/100  Signal level:-121 dBm  Noise level:-115 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sit0      no wireless extensions.

ip command

$ /sbin/ip addr show
1: lo:  mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.xxx.xxx/24 brd 192.168.xxx.255 scope global eth0
    inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
3: rausb0:  mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.xxx.xxx/24 brd 192.168.xxx.255 scope global rausb0
    inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
4: sit0:  mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0
$

iwpriv command

$ /usr/local/sbin/iwpriv
lo        no private ioctls.

eth0      no private ioctls.

rausb0    Available private ioctls :
          set              (8BE2) : set 1024 char & get   0
          stat             (8BE9) : set 1024 char & get 1024 char
          get_site_survey  (8BED) : set 1024 char & get 1024 char
          get_RaAP_Cfg     (8BEF) : set 1024 char & get   0
          auth             (8BE7) : set   1 int   & get   0
          enc              (8BE8) : set   1 int   & get   0
          wpapsk           (8BEA) : set  64 char  & get   0
          psm              (8BEB) : set   1 int   & get   0

sit0      no private ioctls.
$

iwspy command

$ ping 192.168.xxx.xxx
PING 192.168.xxx.xxx 56(84) bytes of data.
64 bytes from 192.168.xxx.xxx: icmp_seq=0 ttl=64 time=0.107 ms
64 bytes from 192.168.xxx.xxx: icmp_seq=1 ttl=64 time=0.109 ms
64 bytes from 192.168.xxx.xxx: icmp_seq=2 ttl=64 time=0.122 ms
...
$ /usr/local/sbin/iwspy rausb0 192.168.xxx.xxx
Arp failed for 192.168.xxx.xxx on rausb0... (6)
Try to ping the address before setting it.
No valid addresses found : exiting...
$ /usr/local/sbin/iwspy
lo        Interface doesn't support wireless statistic collection

eth0      Interface doesn't support wireless statistic collection

rausb0    Interface doesn't support wireless statistic collection

sit0      Interface doesn't support wireless statistic collection

General Linux Network configuration

The following general links are useful references when setting up a Linux Networking and Wireless Networking configurations:

URLSummary/Description
http://linux-wless.passys.nl/query_chipset.php?chipset=Ralink Linux Wireless LAN support; chipset
http://linux-wless.passys.nl/query_chipset.php?brandname=Edimax Linux Wireless LAN support; manufacturer
http://www.brennan.id.au/04-Network_Configuration.html Chapter 4 Network Configuration (not specific to wi-fi)
http://martybugs.net/wireless/rh9.cgiBA Linux Wireless Router: RedHat 9 on Celeron 466
http://www.oreillynet.com/pub/a/wireless/2001/03/06/recipe.html Recipe for a Linux 802.11b Home Network
http://www.x-tend.be/~raskas/blog/category/linux-sysadmin/ Posts filed under 'Linux SysAdmin' (Raskas' blog)
http://www.troubleshooters.com/lpm/200612/200612.htm#_part1 Trouble-shooting
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch13_:_Linux_Wireless_Networking Linux Home Networking Ch 13
http://www.maxp.net/software/wmp54g-linux.html Installing the Linksys WMP54G
http://questier.com/howto.html Various ...
http://www.marlow.dk/site.php/tech/madwifi Multiband Atheros Driver for WiFi (madwifi) package for Debian
http://www.lesbell.com.au/Home.nsf/0/4ad6e47c5fd8e44dca256e39002567c5?OpenDocument Wireless Networking with Linux
http://elibrary.fultus.com/technical/index.jsp?topic=/com.fultus.redhat.elinux4/manuals/rhel-ig-s390-multi-en-4/s1-s390info-addnetdevice.html Red Hat Enterprise Linux 4: Installation Guide
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html Wireless LAN resources for Linux
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/DISTRIBUTIONS.txt Distribution specific notes on Wireless Configuration

Ralink RT cards

The following links are more specific to Ralink Wi-Fi card configuration under Linux:

URLSummary/Description
https://help.ubuntu.com/community/WifiDocs/Driver/RalinkRT73 RalinkRT73 (Wifi Adaptor) WifiDocs and Driver information
http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page Main Page From Rt2x00Wiki
http://rt2x00.serialmonkey.com/wiki/index.php?title=HOWTOSO HOWTOs From Rt2x00Wiki
http://forums.ralinktech.com.tw/phpbb2/index.php Ralink Index
http://wiki.archlinux.org/index.php/RT73_Wireless archlinux: RT73 Wireless. This page describes how you can make the original Ralink RT73 (aka RT2571) drivers work.

WLAN: ipw2000 (on Acer 4000WLMi LAPTOP)

The following links are more specific to ipw2000 WLAN configuration under Linux:

URLSummary/Description
http://www.linuxquestions.org/questions/linux-wireless-networking-41/ipw2200-working-in-fedora-core-4-how-to-inside...-382213/ ipw2200 orking in Fedora Core €4
http://www.linuxquestions.org/questions/slackware-14/slackware-12-and-intel-prowireless-2200bg-598597/?highlight=ipw2200 Slackware 12 and Intel PRO/Wireless 2200BG
http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:madwifi#support_for_wpa_encryption Slackware support for WPA encryption
http://www.linuxquestions.org/questions/debian-26/i-installed-ipw2100-from-debian-now-what-wireless-593577/?highlight=ipw2200 IPW2100 installation on Debian