NetworkManager and GSM Dial-Up over Bluetooth

NetworkManager has support for Dial-Up connections for some time now. It’s not polished or very straightforward, but it is at least usable. Let me describe how to set it up. To make it harder, I will describe how to connect over a mobile GSM modem.

First, we need to setup mobile modem port in BlueZ.

[smoku@wing ~]$ hcitool scan
Scanning ...
[...]
00:12:C1:D9:CF:24       Smocza N80

There is my mobile. Let’s see what it is capable of:

[smoku@wing ~]$ sdptool browse 00:12:C1:D9:CF:24
Browsing 00:12:C1:D9:CF:24 ...
Service Name: AVRCP Target
Service Description: Audio Video Remote Control
Service Provider: Symbian Software Ltd.
[...]

Service Name: Dial-Up Networking
Service RecHandle: 0x1000d
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x454e
encoding:    0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

So, there is an Dial-Up Networking Service present. What we are interested in, is the Channel it is working on. Most of the time it is 1 for DUN. So knowing that, lets setup the rfcomm port for it in /etc/bluetooth/rfcomm.conf:

rfcomm0 {
bind yes;
device 00:12:C1:D9:CF:24;
channel 1;
comment "Smocza N80 DUN";
}

To test it just do: echo > /dev/rfcomm0 - you should see established BT connection on a mobile for a short time.

Next, we need to setup the Dial-Up connection under GNOME: System -> Administration -> Network. First let’s add the freshly created rfcomm device. On the Hardware tab click “New”, select Modem type and enter Modem device /dev/rfcomm0, speed 115200, Hardware(CRTSCTS) flow control and select tone dialing.

rfcomm modem under GNOME

Next on the Devices tab click “New” button, select “Modem connection”. Type phone number, name of your provider and login/password. For my PlusGSM mobile operator it is *99***1# number and password is not required, so I typed ppp/ppp becouse the interface insisted. Next select automatic address assignment or enter one given by your operator. And you’re done.

Now you need to reload NetworkManager for it to see the Dial-Up connection available. If you do not know how to do that, just reboot the machine.

It’s almost done now. Just one more step - my mobile modem needs special init string AT+CGDCONT=1,”IP”,”www.plusgsm.pl”,”",0,0 to set it up for my GPRS provider. Fortunately wvdial (which runs under the hood) allows us to specify additional arbitrary init strings. We need to add it to /etc/wvdial.conf. I added as Init5 in [Dialer PlusGSM] section.

[Modem0]
Modem = /dev/rfcomm0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM0
FlowControl = CRTSCTS
[Dialer PlusGSM]
Username = ppp
Password = ppp
Phone = *99***1#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = ATE1
Init5 = AT+CGDCONT=1,"IP","www.plusgsm.pl","",0,0
Inherits = Modem0

Now just select your connection using the NetworkManager applet menu.

NetworkManager with Dial-Up

Unfortunately the connection progress and state isn’t monitored yet. So the applet icon doesn’t change anyhow. The only way to monitor if everything works fine is to check /var/log/messages NetworkManager messages. But once it worked for me, I do not need to do it anymore. I just select the menu item, wait a few seconds and it’s up and running.


About this entry