Howto: Share mobile broadband in Ubuntu using only the GUI

Howto: Share mobile broadband in Ubuntu using only the GUI


Like many people who aren't able to get DSL, I use mobile broadband. Typically, at least in Ireland and the UK, you are forced to purchase a modem with your contract. What if you want other devices in your house to use this broadband and you don't want to fork out several hundred wing wangs for a mobile broadband router like the Novatel MiFi when you have a perfectly good modem and wireless router already? In Ubuntu you can setup the modem-connected machine as a robust router/firewall using the in-built Network Manager, Firestarter, and optionally, Gadmin DHCPD. These are all GUI tools and so there is no need to go near the dreaded command line here.

Modem Setup

With the release of Ubuntu Jaunty Jackalope mobile broadband setup has become very easy and intuitive. Simply plug the modem in and in a few seconds the "New Mobile Broadband Connection" wizard should appear. Click "Forward" and you will be presented with a list of mobile broadband providers relevant to your geographical location. Select the provider you use and click "Forward" again. See Figure 1.

Figure 1: choose broadband providerFigure 1: choose broadband provider

Now you are presented with a summary screen. You can change the name if you like but, unimaginatively, I just stuck with the defaults. Hit "apply" and then make the connection come up automatically. Right click the Network Manager task bar and choose "Edit Connections". Click the "Mobile Broadband" tab, select the connection we just made and click the "Edit" box. See Figure 2.

Figure 2: edit broadband connectionFigure 2: edit broadband connection

Tick the box to "Connect automatically", hit "Apply" and you are ready for the next stage of the setup, as in Figure 3.

Figure 3: automatic connectionFigure 3: automatic connection

At this stage the mobile broadband should be connected and you should see the wireless mast-type icon on the Network Manager task bar as below in Figure 4. If not, you may need to look at the trouble shooting section.

Figure 4: broadband away!Figure 4: broadband away!

Setup Routing

With the release of Ubuntu Jaunty Jackalope mobile broadband setup has become very easy and intuitive

Now we need to protect ourselves and also masquerade the local network so that other devices can access the internet through your machine. Firestarter is a very user friendly and simple firewalling solution to setup. Firstly go into Synaptic by clicking the "System" menu, going into "Administration" and then clicking "Synaptic Package Manager". In the search box type "firestarter", right click and choose "Install this package", then click apply. See Figure 5.

Figure 5: install firestarterFigure 5: install firestarter

Now, to configure Firestarter click "Applications", "Internet" and then "Firestarter". You will be presented with a wizard again. Click "Forward" as the wizard suggests and see Figure 6.

Figure 6: configure internet deviceFigure 6: configure internet device

All mobile broadband devices use PPP so select "Dialup device (ppp0)" from the drop-down menu and also select "Start the firewall on dial out" as in Figure 6 above. Now we've to select which LAN device is to be routed/masqueraded. Typically this would be wlan0 (for wireless) or ath0 if you are using an Atheros card with the old proprietary HAL, or even eth0 if you aren't using wireless. Also tick the box which says "Enable internet connection sharing" and again click "Forward". See Figure 7 below.

Figure 7: configure network deviceFigure 7: configure network device

Make sure "Start firewall now" is ticked and click on save. At this stage, assuming you are using a wireless access point with a DHCP server built in, you need to make sure your machine has a static IP configured in the range of your wireless network and to tell the DHCP server that this static IP is the gateway for the network. For instance my home network uses 192.168.0.0/24 as it's network addressing scheme and I have my mobile broadband attached to a machine with address 192.168.0.254. Refer to your wireless access point's documentation for details on how to change the default router in the network scope options. You will also need to setup the relevant DNS servers (from your mobile broadband connection) in this network scope.

Setup DHCP server (optional)

If for some reason your access point doesn't have it's own DHCP server or you are using good old fashioned ethernet with a switch then you will need to setup a DHCP server on the broadband machine itself. I found that trying to use the bundled Firestarter DHCP functionality didn't work in Jaunty Jackalope even if a DHCP server was installed and started. In Synaptic do a search for DHCP and then select and install "gadmin-dhcpd". See Figure 8 below.

Figure 8: install gadmin dhcpdFigure 8: install gadmin dhcpd

Start Gadmin DHCPD under "Applications", "System Tools". Now you need to set up a scope. Obviously, replace the settings below with your own. Figure 9.

Figure 9: add DHCP scopeFigure 9: add DHCP scope

Then add in the router and DNS addresses using the relevant settings for your network and broadband connection. Figure 10.

Figure 10: gateway and dns addressesFigure 10: gateway and dns addresses

Troubleshooting

HSDPA modem problems

the connection and therefore firewalling/masquerading will not start unless you are logged in

It is entirely possible you have a newer HSDPA modem which isn't automatically handled by the kernel. When I say "handled" I am referring to the mechanism which tells the device to go from storage mode (typically how the device drivers are loaded in Windows) to modem mode. For instance I own a Novatel Wireless XU950D. I have to use a package called "usb-modeswitch" which is called by udev upon device insertion to do the switching.

If your device has been correctly detected and switched you should have output similar to the following in syslog. Figure 11.

Figure 11: correct log output for a HSDPA modemFigure 11: correct log output for a HSDPA modem

If in doubt there no harm installing usb-modeswitch anyway. It can be found here,downloaded and installed using Gdebi.

Broadband provider settings change

In the last few weeks my mobile broadband provider has changed from private to public addressing of broadband clients. This involved an APN and DNS settings change. It is worth noting this as it is entirely possible that the network manager settings could be out of date. Figures 12 and 13.

Figure 12: APN settings have change for ThreeFigure 12: APN settings have change for Three
Figure 13: DNS server addresses for Three are now in public as opposed to private address rangesFigure 13: DNS server addresses for Three are now in public as opposed to private address ranges

Conclusion

Obviously as the connection is controlled by the Network Manager, which is a "user" context app, the connection and therefore firewalling/masquerading will not start unless you are logged in. You could set automatic logins so that it will launch on startup regardless, otherwise or you will have to find another solution.

Assuming everything went well you should now be sharing your broadband on your network. If not, do ask a question in comments or feel free correct me.

Category: 

Comments

Nookawarra's picture
Submitted by Nookawarra on

Thanks for the post John - very helpful. I am currently using satellite in country Western Australia and would like to change to mobile because connecting a router to the satellite modem causes all sorts of problems. My house is has very thick walls and a metal roof and mobile signals inside are poor to non existent. Also the construction of the house makes it difficult to run an aerial cable. Is there a way of having an external aerial connected wirelessly to a USB modem? Obviously the external aerial would need to be powered separately. This would save me a lot of trouble in running an aerial lead.

Author information

John Lewis's picture

Biography

John Lewis is a computer services provider based in the South East of Ireland, with more than 10 years experience and particular emphasis on FOSS. Please see http://www.johnlewis.ie for more information.

Most forwarded

Interview with Dave Mohyla, of DTIDATA

Dave Mohyla is the president and founder of dtidata.com, a hard drive recovery facility based in Tampa, Florida.

TM: Where are you based? What does your company do?
DTI Data recovery is based in South Pasadena, Florida which is a suburb of Tampa. We have been here for over 10 years. We operate a bio-metrically secured class 100 clean room where we perform hard drive recovery on all types of hard disks, from laptop hard drives to multi drive RAID systems.

Anybody up to writing good directory software?

Since the very beginning, directories (of any kind) have had a very central role in the internet. (I have recently grown fond of Free Web Directory. Even Slashdot can be considered a directory: a collection of great news and invaluable user-generated comments. As far as software is concerned, doing a quick search on Google about software directories will return the free (as in freedom) software directories like Savannah, SourceForge, Freshmeat and so on, followed by shareware and freeware sites such as FileBuzz, PCWin Download Center and All Freeware (great if you're looking for shareware and freeware, but definitely less comprehensive than their free-as-in-freedom counterparts).

Interview with Mark Shuttleworth

Mark Shuttleworth is the founder of Thawte, the first Certification Authority to sell public SSL certificates. After selling Thawte to Verisign, Mark moved on to training as an astronaut in Russia and visiting space. Once he got back he founded Ubuntu, the leading GNU/Linux distribution. He agreed on releasing a quick interview to Free Software Magazine.

Is better education the key to finding better software?

I read David Jonathon's article Anybody Up To Writing Good Directory Software? the other day, which got me thinking about software directories in general. As David mentioned, many of the software directories one finds when doing a quick google search are free as in beer, not as in freedom. But what interests me is the software directories that already exist, providing a combination of both free as in beer software, and open source software. Sites such as Freeware Downloads and Shareware Download don't advertise themselves as providing free as in liberty software, but each of them have a good selection of open source software available... if you know where to look.

Most emailed

Free Open Document label templates

If you’ve ever spent hours at work doing mailings, cursed your printer for printing outside the lines on your labels, or moaned “There has got to be a better way to do this,” here’s the solution you’ve been looking for. Working smarter, not harder! Worldlabel.com, a manufacture of labels offers Open Office / Libre Office labels templates for downloading in ODF format which will save you time, effort, and (if you want) make really cool-looking labels

Creating a user-centric site in Drupal

A little while ago, while talking in the #drupal mailing list, I showed my latest creation to one of the core developers there. His reaction was "Wow, I am always surprised what people use Drupal for". His surprise is somehow justified: I did create a site for a bunch of entertainers in Perth, a company set to use Drupal to take over the world with Entertainers.Biz.

Update: since writing this article, I have updated the system so that the whole booking process happens online. I will update the article accordingly!

So, why, why do people and companies develop free software?

More and more people are discovering free software. Many people only do so after weeks, or even months, of using it. I wonder, for example, how many Firefox users actually know how free Firefox really is—many of them realise that you can get it for free, but find it hard to believe that anybody can modify it and even redistribute it legally.

When the discovery is made, the first instinct is to ask: why do they do it? Programming is hard work. Even though most (if not all) programmers are driven by their higher-than-normal IQs and their amazing passion for solving problems, it’s still hard to understand why so many of them would donate so much of their time to creating something that they can’t really show off to anybody but their colleagues or geek friends.

Sure, anybody can buy laptops, and just program. No need to get a full-on lab or spend thousands of dollars in equipment. But... is that the full story?

Fun articles

Santa Claus - the most successful open source project

It dawned on me the other day, as I was shopping for the dozens of gifts it seems I have to buy every December, that Santa Claus is the most successful open source project in history. (Bridget @ Illiterarty would agree with that). Santa Claus is essentially a marketing development that is embodied by everyone who stuffs a sock, gives a gift, hosts a dinner or wishes Merry Christmas over the holiday season.

Most emailed

Editorial

When I first started thinking about Free Software Magazine, I was feeling enthusiastic about the dream. I had Dave, Gianluca, and Alan willing to help me, I had established members of the free software community willing to help me out, I had writers volunteering their time and energy for free, and I had a generous offer from OpenHosting for servers, all before I'd proved myself. There was a sense of excitement in the air, and I thought maybe, just maybe, I could make this work.

Free Software Magazine uses Apollo project management software and CRM for its everyday activities!