How to connect Linux to your cellular Internet
Not so long ago, I wrote a guide up that showed T-mobile customers how to connect their cell phone to their Linux machines using wvdial, allowing them to access the Internet. Well I’ve come back to write an updated (and even easier) guide to connecting not just T-mobile phones, but Sprint and Verizon wireless phones as well (and possible others, as you’ll soon see).

So, here we go in short and simple form:
- Switch your phones USB mode to Data Connection (this is usually on Memory Card mode by default). Connect your phone to your computer after this has been configured correctly.
- Install wvdial by opening a terminal window (click on Applications>Accessories>Terminal) and then type in “sudo apt-get install wvdial“.
- Now that your phone is attached to your computer and wvidial is installed, type “sudo wvdialconf” into terminal, and press enter.
The wvdialconf is a useful utility that I failed to use or mention in my previous guide. The wvdialconf utility will probe your computer for modem devices, and upon finding your cell phone and verifying it to be such a device, will test it’s capabilities. Running this command with “sudo” in front of it will allow the program to create it’s own template configuration file based upon your phones capabilities.
wvdialconf will return you to the terminal prompt once it is completed. The next thing you will need to do is modify the configuration file it just created slightly. To do this, type “sudo gedit /etc/wvdial.conf” into terminal and press enter.
Once it opens, it will probably look something like this:
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
; Phone = <Target Phone Number>
ISDN = 0
; Username = <Your Login Name>
Init1 = ATZ
; Password = <Your Password>
Modem = /dev/ttyACM0
Baud = 460800
The above configuration file was what was automatically generated by wvdialconf for me after it probed my Motorola K1, so it may look different for you. Note that the Modem = /dev/ttyACM0 as shown above may be detected differently on your PC, especially if you have attached it to your computer/laptop via a wireless bluetooth connection.
If you have a T-Mobile phone, you will want to modify and save the config file so it looks more like this (I”ve highlighted the most important changes in red):
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = *99#
ISDN = 0
Username = user
Init1 = ATZ
Password = pass
Modem = /dev/ttyACM0
Baud = 460800
Be sure to remove the semi-colon’s in front of the Username / Password lines. T-mobile authenticates it’s users by their phone number (and likely their phones mac address, so a username and password is not required from them. I’ve had no problem using the username “user” and the password “pass” with T-Mobile’s servers).
If you have a Sprint phone, you will want to modify the file so it looks like this:
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = #777
ISDN = 0
Username = {your phone number}@sprintpcs.com
Init1 = ATZ
Password = {your four digit access code}
Modem = /dev/ttyACM0
Baud = 460800
New PPPD = Yes
ISDN = 0
In addition, you will want to do a sudo gedit /etc/ppp/peers in a terminal window and add the following two lines to the file:
lcp-echo-failure 0 lcp-echo-interval 0
If you have a Verizon Wireless device, you will want to make your config file look more like this:
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = #777
ISDN = 0
Username = {your phone number}@vzw3g.com
Init1 = ATZ
Password = vzw
Modem = /dev/ttyACM0
Baud = 460800
—–
Once you have modified the configuration file correctly and saved it, you can close it and return to the terminal window. From now on, after your cell phone is connected, all you have to do to initiate the dialing sequence is type “wvdial” into a terminal window and press enter. Closing the terminal window, or hitting CTRL-C while it is open, will terminate your connection.
Like the sprint device, I also don’t have a verizon device handy for testing to see how well the above guide will work. But it is a big step in the right direction for most people. If you use this guide above and have trouble, please contact so we can seek out a better method for your prefered device. I would love to know of your experience with trying this on your computer.
Good luck!
November 6th, 2008 at 6:54 pm
Thanks, works like a charm on Tmobile Tm 506 with HP Dv6000z and Ubuntu 8.10.