Wednesday 25 June 2008

Madwifi setup after driver install.

For a long time I have used this Madwifi guide and I had gone to the trouble of abbreviating it to a more friendly list.
However, over time this hand-written page became quite tattered. So now I'm going to transfer all of this list here online so that I'm unlikely to lose it again.
I should mention that many times none of this is necessary and the wifi just starts up on the reboot after the driver install.
In case it doesn't, this list outlines some steps I have found useful (all of these commands are as ROOT):

1. To load the driver module, type:

modprobe ath_pci


2. Now, if you type iwconfig, you should see a list like the following:
eth0 no wireless extensions.

lo no wireless extensions.

wifi0 no wireless extensions.

ath0 IEEE 802.11g ESSID:""
Mode:Managed Frequency:2.457 GHz Access Point: 00:00:00:00:00:00
Bit Rate:0 kb/s Tx-Power:20 dBm Sensitivity=0/3
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=0/94 Signal level=-95 dBm Noise level=-95 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0


3.Then we need to bring up the wireless interface. This is done by typing (as root):
ifconfig ath0 up


4. Scan for Access Points
The first step is to insert the scanning module. Type (as root):
modprobe wlan_scan_sta


Then, type this as root:
iwlist ath0 scan


Which gives an output which looks like this:
ath0 Scan completed :
Cell 01 - Address: 00:06:25:E8:3A:05
ESSID:"eddie"
Mode:Master
Frequency:2.437 GHz (Channel 6)
Quality=37/94 Signal level=-58 dBm Noise level=-95 dBm
Encryption key:on
Bit Rate:1 Mb/s
Bit Rate:2 Mb/s
Bit Rate:5.5 Mb/s
Bit Rate:11 Mb/s
Bit Rate:18 Mb/s
Bit Rate:24 Mb/s
Bit Rate:36 Mb/s
Bit Rate:54 Mb/s
Bit Rate:6 Mb/s
Bit Rate:9 Mb/s
Bit Rate:12 Mb/s
Bit Rate:48 Mb/s
Extra:bcn_int=100


5. To connect to an Open AP
type (as root):
iwconfig ath0 essid "AP essid"


6. To connect to an AP with WEP
type (as root)
iwpriv ath0 authmode 1


Now, enter your WEP key like this:
iwconfig ath0 key


7. To get an IP address from a DHCP enabled network, type (as root):
dhclient ath0


You should then see something like:
Internet Software Consortium DHCP Client 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

eth1: unknown hardware address type 24
eth1: unknown hardware address type 24
Listening on LPF/ath0/00:02:6f:20:14:81
Sending on LPF/ath0/00:02:6f:20:14:81
Sending on Socket/fallback/fallback-net
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 7
DHCPOFFER from 192.168.0.254
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.254
bound to 192.168.0.152 -- renewal in 7200 seconds.


Now everything should be fine. There's a lot more detail and variants in the Madwifi guide.

No comments: