Notes about Linux and wireless home connections
 
Preface

Here some notes about using linux with the BT adsl routers. While I didn't have problem when using the VOYAGER 2091 router with Suse 10.0, I had some issues when I moved to Suse 10.1. I had the problem Knetwork manager was loosing the  the EDDI and key information. Other times Suse was loosing the gateway info. I decided to do things manually and test them under different systems. 

BTHomeHub: wireless and Suse 10.1 on a Dell Latitude D610

The first part of the configuration is not very far from the Microsoft one. I opened YAST and for the wireless interface I input the Extended Service set Id (ESSID) (let my say BTHomeHub-AA55) and a 64bit WEP key (a1b2c3d4e5). 

It's worth mentioning here that I'm trying to creating a wireless (IEEE 802.11g) connection to a Wireless Access Point (Managed mode) with an open authentication mode. 

Moreover, the key is in hexadecimal format. In fact, the key for 64-bit is 5 chars (10 hex digits). Here a table for other kind of keys:

05 chars for 64-bit key
13 chars for 128-bit key
16 chars for 156-bit key
29 chars for 256-bit key

Troubleshooting

There is a couple of commands that usually I run to check if I'm connected. 

iwconfig
ifconfig -a 

linux:/home/dallegri # iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11g  ESSID:"BTHomeHub-AA55"  Nickname:"linux"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:12:34:56:78:9A
          Bit Rate=54 Mb/s   Tx-Power=20 dBm
          Retry limit:7   RTS thr:off   Fragment thr:off
          Encryption key:1234-5678-9A   Security mode:open
          Power Management:off
          Link Quality=88/100  Signal level=-41 dBm  Noise level=-87 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:1

sit0      no wireless extensions.
		
                 
Of course I modified some of the data here like ESSID, Access point, key, etc... 

linux:/home/dallegri # ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:14:22:BB:0B:A2
          UP BROADCAST NOTRAILERS 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:169

eth1      Link encap:Ethernet  HWaddr 00:12:34:56:78:9A
          inet addr:192.168.1.65  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: ab12::213:ceff:fe51:82f5/64 Scope:Link
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:294 errors:0 dropped:0 overruns:0 frame:0
          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9933 (9.7 Kb)  TX bytes:7912 (7.7 Kb)
          Interrupt:201 Base address:0x4000 Memory:dfcff000-dfcfffff

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:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3360 (3.2 Kb)  TX bytes:3360 (3.2 Kb)

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)

                 
From both the commands I saw that I was connected to the router and the router gave me the IP address 

192.168.1.65 

Half of the way was done. Now the problem was that I wasn't in Internet yet. The fact that I was not in Internet was clear also from the fact I was not able to ping any known site. 

At the same time the router was connected in Internet because he was able to resolve the site’s name I was trying to ping. 

linux:/home/dallegri # ping www.google.com
connect: Network is unreachable

linux:/home/dallegri # host www.google.co.uk
 is an alias for www.google.com.
www.google.com is an alias for www.google.com.
www.google.com has address 209.85.165.147
www.google.com has address 209.85.165.103
www.google.com has address 209.85.165.99
www.google.com has address 209.85.165.104
www.google.co.uk is an alias for www.google.com.
www.google.com is an alias for www.google.com.
www.google.co.uk is an alias for www.google.com.
www.google.com is an alias for www.google.com.
                 

Here we are. The problem was the missing gateway. You can see this with one of the two commands 

route -n
netstat -n 

linux:/home/dallegri # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
            	

How to add the default gateway if I don't know what is the address of my router? I used the following command 

ip neighbor 

linux:/home/dallegri # ip neighbor
192.168.1.254 dev eth1 lladdr 00:41:f7:d3:c1:d2 REACHABLE
            	

Solution

Now that I know router IP address of the router, the solution is to add the default gateway with the following command. 

route -v add default gw 192.168.1.254 

Now if I check again the routing table, I can see my gateway 


linux:/home/dallegri # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth1

linux:/etc # netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     *               255.255.255.0   U         0 0          0 eth1
link-local      *               255.255.0.0     U         0 0          0 eth1
loopback        *               255.0.0.0       U         0 0          0 lo
default         BThomehub.home  0.0.0.0         UG        0 0          0 eth1
linux:/etc #                   

            	

At this point I'm able to access Internet. Not only, having the IP address I can telnet it or see it's web page at 

http://192.168.1.254 

If the communication drops, it's possible to restore it just with 

service network restart 

BTHomeHub: wireless and Ubuntu on a Dell Latitude D610

With Ubuntu no problem at all. I tested the followings notes on both the 7.04 and 7.10 distributions. The good thing is that Ubuntu comes with already the module ipw2200 for the Intel PROSet/Wireless, so there is no need to download it, build it, and so on. Just a check whether the wireless is on or not, and a list of those available with a simple command 

dallegri@parma:~$ iwlist eth1 scanning
eth1      Scan completed :
          Cell 01 - Address: 00:A4:14:D8:69:6B
                    ESSID:"WANADOO-6870"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:1
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=55/100  Signal level=-68 dBm  
                    IE: WPA Version 1
                        Group Cipher : TKIP 
                        Pairwise Ciphers (1) : TKIP 
                        Authentication Suites (1) : PSK  
                    Extra: Last beacon: 12ms ago
          Cell 02 - Address: 00:3F:17:46:3E:B2
                    ESSID:"MK_HC_Belkin_N1_Wireless_3E46B2"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:1
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=31/100  Signal level=-81 dBm  
                    IE: WPA Version 1
                        Group Cipher : TKIP 
                        Pairwise Ciphers (1) : TKIP 
                        Authentication Suites (1) : PSK  
                    Extra: Last beacon: 72ms ago
          Cell 03 - Address: 00:71:F3:26:67:57
                    ESSID:"Belkin_G_Plus_MIMO_180170"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:6
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=51/100  Signal level=-61 dBm  
                    Extra: Last beacon: 360ms ago
          Cell 04 - Address: 00:12:34:56:78:9A
                    ESSID:"BTHomeHub-AA55"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:11
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=86/100  Signal level=-44 dBm  
                    Extra: Last beacon: 132ms ago

dallegri@parma:~$
                 

Finally I source my simple text file. 

dallegri@parma:~$ cat myBTHome 
sudo iwconfig eth1 essid "BTHomeHub-AB12" key 1234-5678-ab
sudo dhclient eth1
             

All the other parameters have default values that work fine 

dallegri@parma:~$ source myBTHome
Password:
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth1/00:13:ce:15:28:f5
Sending on   LPF/eth1/00:13:ce:15:28:f5
Sending on   Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 192.168.1.254
DHCPREQUEST on eth1 to 255.255.255.255 port 67
DHCPACK from 192.168.1.254
bound to 192.168.1.64 -- renewal in 40440 seconds.
dallegri@parma:~$ 
             

This time there is no need to add the default gateway, and I don't miss any graphical interface tools.

BTHomeHub: wireless and Debian Etch on a Dell Latitude D610

For the progenitor of Ubuntu, things are not so different, but the module ipw2200 for the Intel PROSet/Wireless was not already set as for Ubuntu. First I wanted to upgarde my newly installed Etch. I needed to edit /etc/apt/sources.list because I was not connected to the network during the installation. I added the main US site. I suggest to access the site before adding any reference just to check if the reference is still right. Note that the directories etch, main, and contrib were under the directory http://http.us.debian.org/debian/dists/, but I didn't need to add dists. I just added 

deb http://http.us.debian.org/debian/ etch main contrib
                         

Then I updated my packages database and upgraded my distribution by entering the following two commands 

aptitude update
aptitude dist-upgrade
                         
checked for the version of the kernel 

casa:/home/davide# uname -a
Linux casa 2.6.18-6-686 #1 SMP Fri Jun 6 22:22:11 UTC 2008 i686 GNU/Linux
                         
searched for an updated driver that could fit my kernel version with the command 

aptitude search ipw2200
                         
and installed the proper one 

casa:/home/davide# aptitude install ipw2200-modules-2.6.18-6-686
                         

Next step, I added the wirless interface eth1 editing the file /etc/network/interfaces and adding just two lines. 

#my wifi new entry
allow-wireless eth1
iface eth1 inet dhcp
                         
Last the firmware. I downloaded ipw2200-fw-3.0.tgz directly from http://ipw2200.sourceforge.net, and placed the extracted files under /lib/firmware. I rebooted my laptop. Maybe it wasn't necessary but it worked. As for Ubuntu, I ran 

iwlist eth1 scanning
                         
just for checking my router was seen by the laptop. I wrote my script with something like 

iwconfig eth1 essid "BTHomeHub-AB12" key abcd-1234-e5
dhclient eth1    

but with the proper essid and key, and sourced it. 
http://www.google.co.ukhttp://192.168.1.254http://www.isc.org/sw/dhcp/http://http.us.debian.org/debian/dists/http://http.us.debian.org/debian/dists/http://http.us.debian.org/debian/http://ipw2200.sourceforge.net/shapeimage_4_link_0shapeimage_4_link_1shapeimage_4_link_2shapeimage_4_link_3shapeimage_4_link_4shapeimage_4_link_5shapeimage_4_link_6