Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run Ubuntu 12.04 on an old iMac G3. Since the GUI is too resource heavy I have disabled the display manager (lightdm) and am currently running the computer in console mode. How do I establish a mobile broadband connection from the command line?

When I connect the modem it shows up as ttyUSB0 in the Network Manager device list:

$ nmcli dev
DEVICE     TYPE              STATE        
ttyUSB0    gsm               disconnected    
eth0       802-3-ethernet    unavailable

I have also copied a working connection configuration file from another computer to /etc/NetworkManager/system-connections/Com\ Hem\ Default\ 1. Still, when I try to connect I get an "unknown connection" error:

$ nmcli con up id "Com Hem Default 1"
Error: Unknown connection: Com Hem Default 1.

Any clues?

share|improve this question
You can try with the UUID of the connection, nmcli con list will show you UUIDs. Have you used same device for mobile broadband in two computers? The hardware address(MAC) of modems must match. Also NetworkManager ignores the keyfile if it's readable or writable by anyone but root, so also check its owner & permission. – Samik Jun 23 '12 at 12:43
up vote 1 down vote accepted

wvdial is the tool you need. Install it with sudo apt-get install wvdial if needed. You can configure the connection by editing /etc/wvdial.conf:

[Dialer Defaults]
Phone = <dial-out number here>
Username = 
Password = 
New PPPD = yes

Their man-pages will be really helpful I think. man wvdial and man wvdial.conf for details.

share|improve this answer
Unfortunately the mobile broadband is the only connection I have, so I can't download any packages. Moreover, wvdial is no longer available for PowerPC. However, I think it should be possible to use the command line interface to NetworkManager (nmcli) to get it working. – August Karlstrom Jun 23 '12 at 9:46
@AugustKarlstrom If you have the standard Ubuntu 12.04 disk/usb you should already have wvdial's .deb under /pool/main/w/wvdial, I don't if the PowerPC iso has different files than the intel one, but wvdial's powerPC build for precise is available in launchpad. – Samik Jun 23 '12 at 12:09
The wvdial package is apparently not included in the Ubuntu 12.04 Desktop PowerPC Alternate installation image. Instead I downloaded wvdial from the link you provided together with its dependencies (libuniconf and the libwvstreams packages), copied them to a USB stick and installed the packages on the iMac. Now it works. Thanks! – August Karlstrom Jun 23 '12 at 14:01
Default dial-out number : *99# – totti Feb 2 '13 at 12:09

The CLI way

There are 3 files involved “/etc/ppp/peers/provider”, “/etc/chatscripts/pap” and “/etc/ppp/chap-secrets”.


user "user"

connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T *99#"

# Serial device to which the modem is connected.


# Try to get the name server addresses from the ISP.


# Use this connection as the default route.



# Makes pppd "dial again" when the connection is lost.


# no compression - ppp is used only until the modem







“/etc/chatscripts/pap”:- ABORT BUSY

ABORT           VOICE

ABORT           "NO CARRIER"


ABORT           "NO DIAL TONE"

""              ATZ

OK ATE0V1&D2&C1S0=0+IFC=2,2

OK AT+CGDCONT=1,"IP","3internet"


CONNECT         ""

“/etc/ppp/chap-secrets”:- # Secrets for authentication using CHAP

# client        server  secret                  IP addresses

3ireland        *       3ireland

The most important setting is for the APN in the chat script “3internet”, change this to suit your own provider. You may also need to change usernames and passwords. Until you are confident the connection is working correctly you may also want to enable debugging by uncommenting “#debug” in /etc/ppp/peers/provider. Commonly with 3 the DNS servers don’t get doled out correctly so it may be wise to comment “usepeerdns” and put the DNS servers for your connection into “/etc/resolv.conf” manually.

To start the connection simply type “pon”, to stop conversely “poff”. To start the connection on boot add “pon” to “/etc/rc.local”. To share the connection enable ip forwarding in “/etc/sysctl.conf” and have iptables configured correctly. See for more information on the firewall side.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.