How to connect to the internet using a mobile phone, GPRS/UMTS and OpenBSD's pppd.

I have the following gear :

Note that it's important to have the phone properly configured for this to work. In practice, this means that your phone should be able to access the internet via e.g. the built-in webbrowser.

After connecting the phone with the USB cable to your system and selecting the correct USB mode ('default'), the OpenBSD kernel should detect the following :

	umodem0 at uhub0 port 1 configuration 1 interface 1
	umodem0: Nokia Nokia 6234, rev 2.00/4.52, addr 2, iclass 2/2
	umodem0: data interface 2, has CM over data, has break
	umodem0: status change notification available
	ucom0 at umodem0

Now create a ppp0 device :

	sudo ifconfig ppp0 create

Now add yourself to the groups dialer and network :

	sudo groupmod -G network,dialer [USERID]

Create a chat(8)-script /etc/ppp/peers/chat/umts.swisscom :

	ABORT BUSY ABORT 'NO CARRIER' \
	ATDT*99# CONNECT

This will use the default connection profile from your Nokia phone (*99#) to connect to the internet. You can also configure other connection profiles (in your phone) and use these (with pppd/chat), how to do this is left as an excercise to the reader.

Make an options file for the UMTS/GPRS connection, /etc/ppp/peers/swisscom :

	/dev/cuaU0
	115200
	defaultroute
	lock
	noauth
	connect '/usr/sbin/chat -f /etc/ppp/peers/chat/umts.swisscom'

Since swisscom requires no additional authentication (being a customer is sufficient), you need not worry about username in the pppd-options file, nor about configuring the correct password in /etc/ppp/{p,ch}ap-secrets.

Now connect your phone, make sure it's on and start pppd(8) :

        pppd call swisscom

After pppd connects and gets an IP address from your provider, you should be able to connect to the internet. Note that you may have to configure the proper nameservers for use with this connection. Search the website of your mobile phone provider for this info or look here. Since you are in the groups dialer and network you don't need root permissions to connect. The best way to disconnect is to tell pppd to Hang UP with pkill -HUP pppd. This will send a TermReq to the ppp-peer and the connection will be torn down appropriately.

Please note that this may differ for different types of phones, providers and datacables (below is an old example of a serial cable).

There used to be no supported way to connect to the internet through your phone with bluetooth. As of November 2008, however, bluetooth has been enabled in GENERIC OpenBSD kernels. A description on how to set up bluetooth for dialup will appear here soon.


The following data is preserved for archival purposes. I do not use this setup anymore, but you can still use it as a primer to get your setup working. However, there's no guarantee whatsoever that this still works as documented.

How to connect to XS4All using GPRS and OpenBSD's pppd.

This "Works For Me"™. I have the following :

First create an interface, ppp0 :

	sudo ifconfig ppp0 create

Now add yourself to the groups dialer and network :

	sudo groupmod -G network,dialer [USERID]

Create a chat(8)-script /etc/ppp/peers/chat/gprs.xs4all :

	ABORT BUSY ABORT 'NO CARRIER' \
	AT+CGDCONT=1,"ip","xs4all.nl" OK AT+CGDATA="PPP",1 CONNECT

Make an options file for the GPRS connection, /etc/ppp/peers/gprs :

	/dev/tty00
	115200
	defaultroute
	lock
	user [USERNAME]
	noauth
	connect '/usr/sbin/chat -f /etc/ppp/peers/chat/gprs.xs4all'

Set your username and password in /etc/ppp/pap-secrets :

	[USERNAME]	*	[PASSWORD]	*

Now connect your phone, make sure it's on and start pppd(8) :

	pppd call gprs

After pppd connects and gets an IP address from your provider, you should be able to connect to the internet. Happy Hacking !

Back to OpenBSD stuff

Powered by OpenBSD