Tuesday, August 2, 2011

3G USB dongle in Linux

I purchased this USB dongle for internet connection over 3G. I got one from singtel and one from M1. They are meant to work under Windows and MacOSX, but not under Linux (no surprise here ...).

First the dongle is detected as a storage device (this is where they stored the windows drivers). It's called a "flip-flop" USB gear, or mode switching, or multiple device. Once the windows driver is installed, it manage to switch the mode to modem type device. There is a tool under Linux that does it, called usb-modeswitch, available from the Ubuntu repository. Once installed, the dongle appeared as a modem in my network manager.
See http://www.draisberghof.de/usb_modeswitch/ for more info on the mode switching tool.

Second, I am not sure how to configure the network interface. The configuration window has many fields, but under windows none of them is filled in, except for Number (*99#) and APN (internet on the Singtel card, sunsurf on the M1).

As of now, I can't make it work. The M1 card works on a different computer running Ubuntu and Gnome though, apparently it wasn't too difficult. I am using KDE... So their must be a solution somewhere...

EDIT: installing package mobile-broadband-provider-info helps: it automatically fills in the connection info. Tested under Gnome.

One more trick: the Ethernet card does not provide internet access, but the 3G dongle does. So the network settings have to be configured so that eth0 is not use as a gateway when routing. This can be done (in Gnome) as follow:
System > Preferences > Network Connections
Wired tab, edit the settings for the Ethernet connection
IPV4 tab, click on Route
check "Use this connection only for resources on its network"
Disconnect and reconnect eth0

This should allow connecting to the internet via the 3G dongle. In a terminal, type route and check that the gateway's address corresponds to the one provided by the dongle.