How to get online with Three Mobile (UK) and Linux (Ubuntu)

Three Mobile have recently started offering mobile broadbands a deal from £10 a month. I signed up to their plan, but soon realised that it was quite tricky to get the connection working in linux.

The modem used is marked “ZTE MF622″. The usb ID is 19d2:0001 , the Manufacturer field is “Qualcomm, Incorporated”, and the product field is “ZTE CDMA Technologies MSM”.

The first challenge is to get the device recognised as a modem. When it’s first plugged in it presents itself as a mass storage device (presumably for updating firmware, or holding drivers or dialling settings). To get around this, an update to the udev rules is needed (thanks to UfSoft for this part!) .

I added a new file into /etc/udev/rules.d/ called 25-zte-mf622.rules . The contents are:

ACTION!="add", GOTO="ZTE_End"# Is this the ZeroCD device?

SUBSYSTEM=="usb", SYSFS{idProduct}=="2000",

SYSFS{idVendor}=="19d2", GOTO="ZTE_ZeroCD"

# Is this the actual modem?

SUBSYSTEM=="usb", SYSFS{idProduct}=="0001",

SYSFS{idVendor}=="19d2", GOTO="ZTE_Modem"

LABEL="ZTE_ZeroCD"

# This is the ZeroCD part of the card, remove

# the usb_storage kernel module so

# it does not get treated like a storage device

RUN+="/sbin/rmmod usb_storage"

LABEL="ZTE_Modem"

# This is the Modem part of the card, let's

# load usbserial with the correct vendor

# and product ID's so we get our usb serial devices

RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0001",

# Make users belonging to the dialout group

# able to use the usb serial devices.

MODE="660", GROUP="dialout"

LABEL="ZTE_End"

The next challenge is using the modem to connect to the internet.

Create a file called /etc/ppp/peers/three, and include:

/dev/ttyUSB0
nobsdcomp
novj
nodeflate
ipcp-accept-local
ipcp-no-address
ipcp-no-addresses
ipcp-max-configure 20
user guest
password guest
crtscts
modem
noipdefault
replacedefaultroute
defaultroute
lock
noauth
connect '/usr/sbin/chat -f /etc/ppp/peers/three.chat'
ipcp-restart 8
ipcp-max-configure 50
ipcp-accept-local
ipcp-accept-remote
usepeerdns

Now edit /etc/ppp/peers/three.chat

ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT "NO DIALTONE"
"" ATZ
OK AT+CGDCONT=1,"IP","three.co.uk"
OK ATDT*99***1#
'CONNECT' '\c'
'TIMEOUT' '20'

All being well, you can now connect using “pppd call three”, and disconnect with “killall pppd”

13 Responses to “How to get online with Three Mobile (UK) and Linux (Ubuntu)”

  1. georgedali Says:

    Hi James, I’m compleatly new to Lynux system and I’m desperate to get this modem to connect to my Eee PC.

    Could you send me instructions in how to wright these scripts and save them/ edit them in Lynux. I have a tried and I can get the PC to see the modem not as removable memory when I do a system test of the USB ports, but when I run the network wizard the modem is not there to select from a list.

    Please help, I do not want to install XP just to get this to work.

    Thanks
    Georgedali

  2. admin Says:

    Hi george,

    nano is a simple command line text editor in linux. Maybe get a friend to help you set everything up. If you are near a large city, there will probably be a linux usergroup who would be delighted to help.

    Regards,

    James

  3. istvano Says:

    Hi James,

    this tutorial is awesome thanks a lot, it all works well. My modem switches to modem mode automatically.

    I got connected, I receive an IP address, even my dns is good, my route has been changed, but somehow the connection between the remote and me does not seem to work. I I could not figure it out for everyone else it seems to work well, and I am lost on what I could change. I have tried it on the net for countless hours. so I though you might have some trick I could do. I am using the config files exactly from your blog on Ubuntu 8.04 and ZTE 622.

    May 10 11:46:42 pppd 2.4.4 started by root, uid 0
    May 10 11:46:44 Serial connection established.
    May 10 11:46:44 Using interface ppp0
    May 10 11:46:44 Connect: ppp0 /dev/ttyUSB0
    May 10 11:46:45 CHAP authentication succeeded
    May 10 11:46:45 CHAP authentication succeeded
    May 10 11:46:50 Could not determine remote IP address: defaulting to 10.64.64.64
    May 10 11:46:50 replacing old default route to ath0 [192.168.68.254]
    May 10 11:46:50 local IP address 10.59.45.60
    May 10 11:46:50 remote IP address 10.64.64.64
    May 10 11:46:50 primary DNS address 10.11.12.13
    May 10 11:46:50 secondary DNS address 10.11.12.14

    on windows the local and remote IP are the same. here it is using the default 10.64.64.64 which is I am sure wrong like that.

    Destination Gateway Genmask Flags Metric Ref Use Iface
    10.64.64.64 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
    192.168.68.0 0.0.0.0 255.255.255.0 U 0 0 0 ath0
    169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 ath0
    0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0

    I guess this gateway is wrong.

    If you give some hints where should I start resoving this problem that would be great,

    THANKS A LOT !

  4. admin Says:

    Hi Istanovo,

    I’m not sure what’s going on here. If you figure it out, please post to let others know!

    James

  5. AndyT Says:

    I have created these 3 files…

    but when i put in the command “sudo pppd call three”

    i get an error

    pppd: In file /etc/ppp/peers/three: unrecognized option ‘dev/ttyUSB0′

    i have looked in the directory and can’t find this file.. have i missed something out?

  6. admin Says:

    AndyT:

    Have you plugged the modem in? If so, check to see what gets appended to /var/log/syslog.

    /dev/ttyUSB0 is the device file that should be created when you plug the modem in - check that there isn’t a similar named file created. Your syslog file may help.

  7. Ped Says:

    I just signed up because i was stuck after finding this very usefull blog !

    Im stuck at the first hurdle where is /etc/udev/rules.d/ i have turned on view all files and cannot see that dir at all ?

    Also cannot locate /etc/ppp/peers/three do i have to make these locations my self ?

    Thanks

  8. The Perunix Blog » Instalaci√≥n del Modem GSM de Claro en Linux Says:

    [...] How to get online with Three Mobile (UK) and Linux (Ubuntu) You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. Tags: claro, gsm, linux, mandriva, modem [...]

  9. military genius Says:

    ok i m new to linux I just cant change file in /etc/udev/rules.d/ 25-zte-mf622.rules

    my file has little difference and i think I would have to change it and access denied

    what should i do to be administrator in OS of EEE PC

    I also turned of (log on automatically) in personalization and when i restarted i had onley 1 user to log in and no administrator

  10. admin Says:

    Military genius:

    The command “su” is used to become administrator if you have a text console, or if that doesn’t work try “sudo su -”

  11. Pigmy Says:

    Hi,

    Thanks for the details however I’m struggling to write a new file. I’ve got to /etc/udev/rules.d/ and can see all the files but when I try and save a new file to this location it comes up with an error “Can’t open file to write”. Kind of stops me dead in the water! I’ve tried starting it with su and sudo so - as shown above but it doesn’t help. I’ve got an Acer Aspire One. Any help greatly appreciated

  12. admin Says:

    Hi Pigmy,

    My first guess is that you’re not editing these files as root, but you say you’re using su, so I’m not sure what’s going on there.

    Try writing the file in your normal home directory, then moving it across.

  13. Pigmy Says:

    Hi,

    I’m a bit further advanced now! I’ve followed the instructions above. When I enter pppd call three it returns the error:-
    In file /etc/ppp/peers/three: unrecognized option ‘replacedefaultroute’
    Any idea where I’m going wrong?

    Thanks

Leave a Reply

You must be logged in to post a comment.