For posterity only. Such a setup is now totally outdated !
1. Introduction
This short howto gives some hints on how to connect to the internet with your laptop, using a GSM phone and dial-up networking. This is not a complete guide on how to setup the thing, because all steps are well described elsewhere, but rather a quick note on what stuff have to be put together to make things work.
2. The idea and the required things to concretise the idea
Do you know that your GSM phone can probably be used as a modem ? This is a very interesting feature, if you have a Linux computer with bluetooth, and a GSM phone with dial-up profile and bluetooth. The GSM phone can then become a wireless gateway to transmit data from and to your computer with another remote computer, which will in turn transmit packets to the internet. The best of this is that you can read your e-mail from any location covered by the GSM network, which is in general pretty good. The drawback is that GSM is so slow that don't hope to read more than your e-mails, and pray not to have too big messages... Baud rate is 9600 and ping is around 800-1000ms.
Required stuff :
- Linux computer with bluetooth and pppd
- a GSM phone with bluetooth and dial-up features
- an access point to receive the phone call and relay data to the internet
Note : bluetooth is used here as a link between the computer and the phone, but other solutions exists (USB cable for example). Using bluetooth is quite funny because you can keep your phone hidden in your pocket. This may impress peoples not knowing how you connect to the internet :-)
My actual configuration is based on a Dell Latitude X1 with a Motorola V500 on the client side. On the server side I use the builtin soft modem of a Compaq Armada M300.
3. Client side
(your side, the side of the computer willing to connect to the internet)
- check that your bluetooth device is up : use the hciconfig, it should report something like that :
hci0: Type: USB BD Address: 00:10:C6:64:60:3B ACL MTU: 384:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:279 acl:0 sco:0 events:50 errors:0 TX bytes:449 acl:0 sco:0 commands:32 errors:0
- check that the hci daemon is running, the command ps -fC hcid should report something like :
UID PID PPID C STIME TTY TIME CMD root 28442 1 0 20:49 ? 00:00:00 hcid: processing events
- find the MAC address of your phone, use the hcitool scan command, which reports something like :
Scanning ... 00:0A:28:58:4E:09 ThePhone
00:0A:28:58:4E:09 is the MAC address of your phone. Note that you may need to operate the phone so that it allows to be discovered during 60 seconds for example. - determine what is the channel used on your phone for dial-up networking: try sdptool search --bdaddr 00:0A:28:58:4E:09 DUN :
Searching for DUN on 00:0A:28:58:4E:09 Service Name: Dial-up networking Gateway Service Description: Dial-up networking Gateway Service Provider: Motorola Service RecHandle: 0x10001 Service Class ID List: "Dialup Networking" (0x1103) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 code_ISO639: 0x6672 encoding: 0x6a base_offset: 0xd800 code_ISO639: 0x6465 encoding: 0x6a base_offset: 0xd803 code_ISO639: 0x6974 encoding: 0x6a base_offset: 0xd806 code_ISO639: 0x6573 encoding: 0x6a base_offset: 0xd809 code_ISO639: 0x6e6c encoding: 0x6a base_offset: 0xd80c code_ISO639: 0x7472 encoding: 0x6a base_offset: 0xd80f code_ISO639: 0x7074 encoding: 0x6a base_offset: 0xd812 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100
Look at the Channel: 1 line : this give you the channel value to use in case your phone has more than one channel. - now prepare the rfcomm tty used to exchange data between the computer and the phone over a "serial" link. The command used is rfcomm in bind mode : it means that the link is prepared but really opened only when a software wants to use it. It allows to put the command in the system init scripts. The rfcomm command is of the form : rfcomm bind <dev> <bdaddr> [channel]. <dev> is the serial device used by pppd, <bdaddr> is your phone MAC address, [channel] is optionnal, use it if your phone as several usable channels. In our case the complete command is rfcomm bind /dev/rfcomm0 00:0A:28:58:4E:09.
You need Point to Point Protocol in order to transmit data accross the GSM "serial" line. Under Linux this includes two or three components :
- kernel ppp support : all distributions build their kernel with PPP support, so usually you don't have to care about that. If you are running your own distribution so you know how to build your kernel with ppp support.
- PPP daemon : this system softwares handles packet exchanges over the serial line (in brief). This is a major package also included in all Linux distibutions.
- User software : eventually needed to manage dial-up configurations, etc. Personnally I use kppp, a very smart software
4. Server side
mgetty+sendfax, Auto_PPP
pppd, peers
Using masquerade
This will allow the server to relay data transmission to the internet, in the following example through the eth0 interface.
IF_IN=eth0 IF_OUT=ppp0 /usr/sbin/iptables -A FORWARD -i $IF_IN -o $IF_OUT -m state --state ESTABLISHED,RELATED -j ACCEPT /usr/sbin/iptables -A FORWARD -i $IF_OUT -o $IF_IN -j ACCEPT /usr/sbin/iptables -t nat -A POSTROUTING -o $IF_IN -j MASQUERADE