Debian-Tethering

This article documents how to setup Debian for tethering to an N900. How to setup the N900 is described in the Bluetooth DUN article.

Contents

[edit] Setup Bluetooth connectivity

[edit] Installing required Debian packages

apt-get install bluez-utils pppconfig

[edit] Setting Up Bluetooth Connectivity

blackbox:~# hcitool scan
Scanning ...
  11:22:33:44:55:66       Nokia N900
blackbox:~# sdptool browse 11:22:33:44:55:66

Search for the Dial-Up Networking service

blackbox:~# sdptool browse 11:22:33:44:55:66
Browsing 11:22:33:44:55:66 ...
[...]

Service Name: Dial-Up Networking
Service RecHandle: 0x10005
Service Class ID List:
  "Dialup Networking" (0x1103)
  "Generic Networking" (0x1201)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Profile Descriptor List:
  "Dialup Networking" (0x1103)
    Version: 0x0100

[...]

blackbox:~#

Add an rfcomm device (e.g. rfcomm0) to /etc/bluetooth/rfcomm.conf (make sure to replace the Bluetooth device address 11:22:33:44:55:66 with the Bluetooth device address of your N900):

/etc/bluetooth/rfcomm.conf
rfcomm0 {
#       # Automatically bind the device at startup
        bind yes;
#
#       # Bluetooth address of the device
        device 11:22:33:44:55:66;
#
#       # RFCOMM channel for the connection (whatever you get from the sdptool output)
        channel 1;
#
#       # Description of the connection
        comment "N900";
}

Restart the bluetooth stack:

blackbox:~# /etc/init.d/bluetooth restart

For bluetooth pairing you can run

blackbox:~# cat < /dev/rfcomm0

and first the N900 then the Debian system should ask you for a 4 digit PIN which you define on the N900 and confirm on the Debian system. You might have to configure the helper application which is using the PIN in /etc/bluetooth/hcid.conf

[edit] Dial-Up Settings

Run pppconfig and use /dev/rfcomm0 as the modem interface:

In my settings for klarmobil (Germany) I manually added two lines (at+cdgcont=... and AT+CREG...):

blackbox:~# cat /etc/chatscripts/klarmobil
# This chatfile was generated by pppconfig 2.3.18.
# Please do not delete any of the comments.  Pppconfig needs them.
#
# ispauth PAP
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
 ATZ
# ispnumber
OK at+cgdcont=1,"IP","internet.t-mobile","",0,0
OK AT+CREG=2
OK-AT-OK "ATDT*99#"
# ispconnect
CONNECT \d\c
# prelogin 
 
# ispname
# isppassword
# postlogin
 
# end of pppconfig stuff
blackbox:~#

In my peers file I changed the baud rate to the device

blackbox:~# cat /etc/ppp/peers/klarmobil
# This optionfile was generated by pppconfig 2.3.18.
#
#
hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/klarmobil"
debug
/dev/rfcomm0
#460800
921600
defaultroute
noipdefault
user "tm"
remotename klarmobil
ipparam klarmobil 

usepeerdns
blackbox:~#

For ifupdown integration add to /etc/network/interfaces

iface ppp0 inet ppp
 provider klarmobil

Details are in the Debian Reference.