Hello World! I just discovered how to connect to the internet with my pocketpc (got Windows Mobile 5 installed).
My workstation is an IBM T42 (thanks for not having blowing-up batteries
) with an integrated bluetooth module.
Actually, I work with kubuntu 6.06.
First you need the core bluetooth packages for communicating with your bluetooth device:
$ apt-get install bluez-utils bluez-pin
After that, enable pand to start at boot:
$ vi /etc/default/bluez-utils
Change the lines below:
PAND_ENABLED=1
PAND_OPTIONS="--listen --role NAP"
To enable pin exchange, you need to give a 4-digit number:
$ vi /etc/bluetooth/pin
1234
Now when you connect with your device to your nap (Network Access Point, in my case the t42),
pand executes the dev-up script. It also creates a network interface (bnep0) for network access to the
device.
This is practical, so can add a little script to enable ip-forwarding:
Create the directory and add the script:
$ mkdir /etc/bluetooth/pan
$ vi /etc/bluetooth/pan/dev-up
The ip address in the script below is for our small network between the nap and the device.
Just give an address which is non-routable.
Remember: The subnetmask on your device has to accord to the one on your nap.
Code:
#!/bin/sh
logger -t pand "Bluetooth device discovered. Device addr: $2"modprobe ipt_MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
logger -t pand "Activated POSTROUTING and MASQUERADE for eth0"
ifconfig bnep0 192.168.100.1
logger -t pand "Started bnep0. pand ready for communication."
Add execute-flag to the dev-up script:
$ chmod +x /etc/bluetooth/pan/dev-up
Now we need a little tool for dns forwarding:
$ apt-get install dnsmasq
Now just restart the bluetooth services on your nap:
$ /etc/init.d/bluez-utils restart
From this point, the server or laptop or whatever is open for pan-challenge.
We only have to configure the network interface on the pocketpc:
- IP Address: 192.168.100.2
- SubnetMask: 255.255.255.0
- Gateway: 192.168.100.1
- DNS-Server: 192.168.100.1
Now enable bluetooth on the device and open a new partnership with the nap.
Use the pin, which you gave in /etc/bluetooth/pin.
Yeah, you got it. If everything works as designed, you’re online now.
Feel free to ask questions as a comment to this blog entry.
PS: All above is written by me, so there is no copyright on it 
But, if you like to publish the same tutorial, please inform me with a simple mail!
Thanks
More information at:
- Bluetooth Profiles
- NAT
written by simcen