Wireless Tethering Android with Slackware
Almost two years ago I wrote a how to on tethering with my G1 and Slackware, located here. This was back before I rooted my phone to breathe more life back into it. I still have the phone and plan on having it for a long time. Sure it is as slow as can be, but I still love the full qwerty keyboard… oops, sorry, I’m not here to talk about that. Anyways, like I was saying. I rooted my phone and I’m currently running CyanogenMod 6.0 on my G1.
Wireless Tethering allows you to connect your computer through the phone and use the 3G (or 4G, EDGE, etc) as your internet connection. Some new phones can do wireless tether without rooting, but often times you must pay extra for the service. If you rooted your phone there are two ways of doing wireless tether. First check and see if you have wireless tethering built into your MOD. Go to Settings –> Wireless & networks –> Tethering. If you only see USB tethering then there are extra steps you must take to enable wireless tethering. See the 3 images below. Note that my phone only lists USB Tethering. If your phone is the same, then continue.

Some people I know are also running CyanogenMod and they have wireless tether built in. Why is that? For starters, since the phone is newer than my G1, they have a more up to date wireless card. These cards can be put into AP mode. This is the same style mode that your wireless router at home uses. Some phones that have wireless tether can also put the card into Ad-Hoc mode. This mode is also known as Computer to Computer without an Access Point. However, it seems that you still need the extra software to do wireless tethering. It is kind of hard for me to explain as I don’t have access to many phone to see how they work. Let alone ones that are rooted. With my G1, I can say that the wireless card was not even designed to operate in Ad-Hoc mode. Thanks to the software I’m running I can force the card into Ad-Hoc mode and connect to it with my laptop.
Keep in mind that wireless tethering will kill your battery quickly. Be sure to have a USB charging cable with you as your battery will not last long. Also note that many service providers do not want you to tether without paying extra. Be sure to read the terms of service of your provider before continuing.
If you made it this far you are going to need extra software. Once again, if your phone is not rooted this will NOT work! Head on over to Google Code to download. At the time of this writing I am running version 2.0.2. A later version has been released, but I have not tested it as mine works very nicely. Download the software to your phone and install. If you don’t know how, I can’t help you.
After installing there are several features to the software. I highly recommend encryption and if you want, Access Control. By default the software uses wpa_supplicant to set the WEP key. This is done via a passphrase. If you like the shell (like I do) you will need to use iwconfig to set the key. Below are some pictures of the settings menu in Wireless Tether.


If you use Access Control, before a newly connected device can access the net you will have to allow it. I don’t have pictures, but if I remember it will be in the notification bar. Just drag it down, select the computer/device and hit allow. Later you can look in the Access Control Panel by hitting Menu then Access Control. Here is what mine looks like (and no, the computer is not actually connected. I just have it set to always allow the machines based on it’s MAC address.

My laptop has a Broadcom wireless card. I’m using the b43 drivers found here. As it turns out there are several problems found with my current kernel version (2.6.28) and the rc.wireless script that Slackware uses. There are two fixes. One is to remove the b43 module and reload it (this is so we can put the card in Ad-Hoc mode) and I have had problems setting the WEP key via iwconfig. With iwconfig you can set the key (default for this software being ‘abcdefghijklm’) by typing:
iwconfig <card-id> key s:<passphrase>
I always got an error. I solved the problem by using another computer to set the key then you can type iwconfig again and see the key. In this case, the key is 6162636465666768696A6B6C6D. If needs be, write down this key so you can use iwconfig to set it again.
Ok. I hope by now you have the wireless software installed on your Android phone and it is running. Note: I have found that sometimes even when encryption is set it doesn’t turn on. Be sure to scan for wireless networks to see your phone and if encryption is turned on or not. Also note that the software has created an Ad-Hoc style connection. If everything seems to be working here is what you do. In the next steps I will have some bash commands, then a note on what each command does. You may need a make changes to it to suit your needs. I turned it into a script I can run on my laptop so I don’t have to type every line in every time I tether.
rmmod b43 -unloads the b43 module modprobe b43 -reloads the b43 module ifconfig wlan0 down -take the card offline iwconfig wlan0 mode ad-hoc -set to Ad-Hoc mode iwconfig wlan0 essid android -set the essid (be sure to check your configs) iwconfig wlan0 key 6162636465666768696A6B6C6D -set the WEP key (may differ!) ifconfig wlan0 up -bring the card online dhclient wlan0 -get an IP address to your phone
Now type ifconfig and make sure you have an IP. If so, try surfing! If you are a hardcore Slackware user you may note that I use dhclient instead of dhcpcd. For some reason dhcpcd never gets me an IP. If this doesn’t work try it again. Sometimes I have to run the script twice, but I always get it working eventually.
I don’t have a problem with Windows 7 on the same machine. Windows will allow you to type in the paraphrase and it works great. If you’re running Linux and using the b43 module there are several things you can try to fix any problems. I hear the 2.6.33 and newer kernel have these problems fixed. Also if you don’t run a wireless script on boot, that may help. Most newer Linux distributions have GUI programs to help you connect to networks. I’m still running an older version of Slackware, and at the time, it didn’t come with those programs.
Now for some more pictures I took of the program. No reason. I just thought I would share.


I hope this all makes sense. If not you can always ask, if I know the answer I will reply. I would also recommend asking on a help forum or asking Google. Good luck and Happy Hacking!







