Full Details on Tethering a 3g Modem to Linux

Full Details on Tethering a 3g Modem to Linux
Page content

Having Internet access is seen by many as a prerequisite for home or business computing, but if there is no Ethernet connection in your home or workplace and Wi-Fi connectivity isn’t up to much in the local café or shopping mall, you might have trouble connecting to the net.

Unless you try the third option.

You probably have not failed to notice the popularity of 3G Internet dongles that have been made available for home computers, netbooks and laptops over the past few years. Typically shipped by mobile phone suppliers, these devices feature a SIM card and provide Internet connectivity to anyone currently on the move, or anyone who doesn’t want the inconvenience of wires strewn around their home and cannot afford the outlay of a wireless modem/router.

The problem with these 3G dongle solutions is that if you don’t use Windows or Mac OS X, the network providers and device manufacturers don’t provide a means for accessing the web from a Linux box. Given that over the past few years many netbooks (and in the case of Dell, desktops and laptops) have shipped with Linux distros pre-installed, it seems that a significant chunk of users are being ignored.

Thankfully, as with all things open source, there is a useful solution, allowing users to tether a 3g dongle to a Linux computer. Better still, if you don’t have a dongle, there is still the option of using a mobile phone.

In a world usually dominated by Windows and Mac OS X solutions it is good to know that there is a way around many of this particular piece of open source blindness.

Many 3G dongles are available; from the standard USB thumb drive type (that often also include a MicroSD card slot) to the slightly bulkier devices that are connected via a short USB cable.

Whether you have purchased one of these online or been supplied one by your ISP or mobile provider (perhaps as a loyalty bonus) you will need to identify what model you are using. This is best done by reading the text on the underside of the dongle, as shown in the accompanying image.

On the right you can see a ZTE K3805-Z modem (top) which offers HSPA network access and a HUAWEI E1550 HSDPA mobile broadband device. Each of these are common and are used by many mobile phone providers who supply them housed in branded cases (the ZTE K3805-Z device is seen here in Vodafone’s red and white livery).

Configuring a 3G dongle for use on Linux depends specifically on the device you are using so you may need to perform further exploration of the topic for your specific model.

Configuring and Using a HUAWEI E1550 Mobile Broadband Device in Ubuntu

Configuring and Using a HUAWEI E1550 Mobile Broadband Device in Ubuntu

With an active SIM card inserted in your dongle, you should be able to gain immediate access to the web via Ubuntu, thanks to the New Mobile Broadband Connection tool. This can be launched by inserting your dongle into the computer, waiting a few moments and then clicking the network icon on the Panel.

To use this you will need the details of the network provider, the payment plan type and the APN (Access Point Name) with which you will be connecting to the web.

Begin by proceeding through the connection tool, selecting your location and network provider, and basically setting things up as per the menus and your existing knowledge about the connection. You may need to check your contract paperwork for a couple of details, but largely this process should be configured automatically in Ubuntu.

Connecting to a 3G modem

Click Finish to complete the configuration tool, and a few moments later you should be greeted by the news that the connection has been established! It shouldn’t be too long before you’re browsing the web with high-speed broadband quality a decent speeds, viewing all of your favorite websites. While some services might offer restricted browsing (see below) others will enable you to enjoy websites like Facebook, YouTube, Pandora, etc.

Configure and Use a ZTE K3805-Z Dongle with Network Provider Software

As well as finding auto-configuration options for your USB 3G dongle in Linux, you will also find that some mobile networks provide their own configuration software, particularly useful if your 3G modem isn’t recognized.

The most popular option here might be Vodafone Mobile Connect – hardly surprising given the network’s massive global profile. You can download the latest version of this software for various Linux distros via www.betavine.net, where you should be prepared to embark on quite a bit of Terminal use…

For Ubuntu users (downloads for other distros are available) head to the Ubuntu download page and click the link to Download the software to your computer. Save the Ubuntu.tgz file in a familiar place (such as Downloads) and then unpack it:

tar xvfz Ubuntu.tgz

This will create a new Ubuntu directory with the following contents:

Ubuntu/ozerocdoff_0.4-2_i386.deb

Ubuntu/usb-modeswitch_0.9.7_i386.deb

Ubuntu/vodafone-mobile-connect_2.20.01-1_all.deb

Ubuntu/INSTALL_UBUNTU.TXT

Installing Vodafone Mobile Connect

After extracting the compressed tarball file, you will then need to begin installing the contents, in the following order:

sudo dpkg -i usb-modeswitch_0.9.7_i386.deb

sudo dpkg -i ozerocdoff_0.4-2_i386.deb

sudo aptitude install wvdial hal usb-modeswitch ozerocdoff python-twisted python-serial python-sqlite python-tz python-gobject python-dbus python-cairo python-crypto python-gtk2 python-gnome2 python-gnome2-extras lsb-release python-glade2

sudo dpkg -i vodafone-mobile-connect_2.20.01-1_all.deb

The reason that these items are installed in this particular order is to ensure that all dependent components are installed. (Note that as you are using sudo (SuperUser) you will need to provide your password for the first installation.)

With this all ready, all you need to do now is run the application from the terminal:

vodafone-mobile-connect-card-driver-for-linux

vodafone-mobile-connect-card-driver-for-linux-debug

Or launch Vodafone Mobile Connect from the Applications > Internet menu. Once running, simply confirm the connection details for your location and contract, enter the APN and you’re ready to connect. Depending on the speed of your connection you will be able to enjoy the web’s most popular websites, potentially in all of their high quality glory, although this will depend on your usage plan as much as your connection speed.

Mobile Phone Tethering

In addition to 3G dongles there are various mobile phone platforms that can be used to provide an Internet connection to Linux systems.

Android, iPhone, Windows Mobile and BlackBerry devices can all be used in this way, which could prove an advantage to your pocket – after all, why spend up to $50 on a dongle when your mobile phone already provides this level of functionality?

Several options are available for some of these, but we’ll limit our summary to the most effective options.

Tether Windows Mobile to Linux

Tether Windows Mobile to Linux

Windows Mobile devices might be on the way out (mainly thanks to Android and the new Windows Phone platform) but they can be connected to Linux computers via the SynCE software, the configuration of which is explained in detail in the article Sync Windows Mobile with Linux.

What isn’t covered in that piece, however, is that by using the Internet Sharing function in the Windows Mobile Programs menu, you can create an instant connection to the Internet that your Linux computer can use without any additional configuration.

Get a 3G Connection in Linux with an iPhone

iPhone users can tether their devices (depending on the network) to an Ubuntu machine but this requires a jailbroken device as the connection must take place via SSH.

This is a potentially tricky one to pull off, so it isn’t something that should be attempted by the inexperienced. Tethering an iPhone in Linux addresses the situation fully, as well as providing other options for the connection of an Apple iPhone to a Linux Ubuntu computer.

Remember that there is also the option of using your iPhone as a wireless hotspot, assuming your Linux computer has a Wi-Fi card.

Tethering Android and Linux

With their shared heritage, you might expect Android and Linux to easily tether, and in the case of Ubuntu you would be absolutely correct. All you need to do is grab your phone, a USB data cable and connect them to your Ubuntu computer. You should then check your phone, drag the notification bar down, click on USB Connected > Don’t Mount and then go to Menu > Settings > Wireless Controls and check the Mobile Network Sharing box.

All you need to do on your Ubuntu computer is go to the Network Manager in the Panel and select Auto usb0 as your new connection!

Using a BlackBerry as a 3G Modem for Linux

If your mobile platform is BlackBerry, meanwhile, you can take advantage of a piece of Linux-based software to enable tethering. Available from www.netdirect.ca/software/packages/barry, Barry is a wide-ranging application that not only allows tethering it also permits various data synchronization methods between a BlackBerry phone and a Linux computer.

Barry is available free and doesn’t require any installation of software on the BlackBerry, only on your Linux computer!

Don’t Overspend on Bandwidth!

Don’t Overspend on 3G Bandwidth!

Who would have thought that there were so many ways to connect to the mobile Internet? As with many other aspects of computing, Linux users are spoiled for choice with support for many 3G dongles, tethered mobile phones offering 3G connectivity adding to the usual Ethernet and Wi-Fi connections.

However, despite this wealth of options, don’t forget that 3G modem dongles and mobile phones feature their own network-controlled restrictions. It is quite easy to find yourself receiving a bill that exceeds all expectations through just a few hours of extra-contractual browsing, simply because you chose the wrong package.

If you’re planning on taking advantage of any of these 3G Linux tethering options, you should spend some time contacting your mobile phone carrier to find out what restrictions are on your current price plan, what your data usage option is, and how easy it is to change to a different data plan.

References

  1. Author’s own experience.
  2. Vodafone Mobile Connect, https://www.betavine.net/bvportal/resources/datacards/os/ubuntu
  3. All images and screenshots provided by the author.