Bluetooth Dial-up Networking in Debian

This post describes how to set up a GPRS/UMTS connection via Bluetooth Dial-up Networking in Debian Squeeze (and Wheezy).

Install bluetooth and ppp packages, if not installed yet:
sudo apt-get install bluetooth ppp

Add your user to usergroup dip to allow dialout (usage of pon/poff commands):
sudo adduser joseph dip

Activate bluetooth on your mobile and figure out its bdaddr:
hcitool scan

Look up channel of „Dial-up Networking“ – „RFCOMM“ (it seems that for most devices it’s channel 1):
sdptool browse 00:11:22:33:44:55

Edit /etc/bluetooth/rfcomm.conf (adjust bdaddr and channel):
rfcomm0 {
bind yes;
device 00:11:22:33:44:55;
channel 1;
}

Edit (create) /etc/ppp/peers/umts-bt (replace „internet.eplus.de“ with your provider’s APN):
debug
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet.eplus.de"
usepeerdns
/dev/rfcomm0 115200
defaultroute
crtscts
lcp-echo-failure 0

Reload bluetooth configuration:
sudo /etc/init.d/bluetooth restart

Set pincode for pairing (keep bluetooth-agent running in background/another window!):
bluetooth-agent 1234

Initiate ppp connection:
pon umts-bt

Now your mobile should show a prompt for the pincode. Enter it and pair. After some seconds the connection should be established and DNS servers and default routes have been configured to use the PPP connection (if no other connection like WiFi or Ethernet is active).

Disconnect:
poff

You can kill bluetooth-agent by pressing CTRL+C. In the future you won‘t need to start it again. pon umts-bt should be enough to establish a connection and poff to disconnect.
The device configuration is stored at /var/lib/bluetooth/BDADDR. You can delete this directory if you want to repeat the pairing/authorizing process.

Debugging

Check if /dev/rfcomm0 has been created (especially on error „… unrecognized option ‚/dev/rfcomm0′“ when doin pon umts-bt):
sudo rfcomm -a
(if this gives no output, check /etc/bluetooth/rfcomm.conf for syntax errors and do a sudo /etc/init.d/bluetooth restart)

Check if ppp0 exists and is connected (e.g. has some ip address assigned):
sudo ifconfig

Check the system log (in real-time):
sudo tail -f /var/log/syslog
If the connection was successful there should be a line with the assigned IP address. Alternatively you can use plog to check pppd’s output:
sudo plog -f

Check if the DNS servers have been set automatically:
cat /etc/resolv.conf


Note: As mobile I‘m using a N900. For this device the bluetooth-dun package must be installed on the mobile („Bluetooth Dial-Up Networking“ in App. Manager or apt-get install bluetooth-dun).
Note (2): Instead of naming the peer configuration file „umts-bt“, you can name it „provider“ (overwrite the original file) and you can connect with just pon instead ofpon umts-bt.