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

OK, I have a shell application running on Ubuntu 11.04 which must use a Verizon Wireless Modem to stay connected. I can't figure out how to invoke this application from the shell, but can do so from the gui.

If the PC looses power, Ubuntu must wake up, log in, start the application in it's last know state, and connect back to the internet. Since the application is REMOTE, I need the PC to reestablish the wireless connection whenever it drops said connection, and keep trying until it does.

I have set the ppp0 as the default connection in network manager. However, the only way I have found to start the connection after disconnect is by killing networkmanager, then network-manager reconnects automatically.

The Connection:

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:XXX.XXX.XXX.XXX  P-t-P:XXX.XXX.XXX.XXX  Mask:
          RX packets:211 errors:0 dropped:0 overruns:0 frame:0
          TX packets:217 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:26851 (26.8 KB)  TX bytes:18801 (18.8 KB)

The process seems to change every time I run it. The NetworkManager seems to autoincrement the number after .../PPP. I want to be able to run this connection with all of it's functionality from the shell. :

/usr/sbin/pppd nodetach lock nodefaultroute ttyUSB0 noipdefault noauth usepeerdns lcp-echo-failure 5 lcp-echo-interval 30 ipparam /org/freedesktop/NetworkManager/PPP/3 plugin /usr/lib/pppd/2.4.5/


Bus 002 Device 006: ID 1410:6000 Novatel Wireless

Can someone provide me with the shell command I can use to invoke the above connection without killing network manager each time?

share|improve this question
up vote 2 down vote accepted

I assume you're managing the connection with Network Manager? If that is the case, you should be able to activate it using the nmcli tool:

nmcli con up id "name"

Where "name" is the name you assigned to the connection in Network Manager. You should be able to integrate this into whatever type of scripting you are using.

If you want to be able to run this command as a user other than the one you log in to the GUI, you will need to check the Available to all users option in the connection's settings.

share|improve this answer
James, thanks for the great response! I will use this in lieu of the one I came up with before you posted this, which was to kill network manager, causing it to come back up and connect to the default location. Thanks much! – Matthew Vona Jun 6 '11 at 15:51
@James It just worked for me. Can you tell me if this would give any error log while tried to establish connection, if any? – souravc Dec 24 '13 at 4:34

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.