When you insert your mobile broadband modem usb stick, it gets activated within 5 seconds or almost, and then modem is on (Modem manager); after several seconds, mobile broadband is enabled through the Network Manager (Network manager applet indicator); hence you manually click your setup connection to connect the modem to your provider network. That's cool.

I changed the settings of a connection to AUTOMATICALLY CONNECT thinking that it would connect automatically to the network once the modem is inserted and on, and the network recognized. Unfortunately it it did not.

Is it possible to achieve the above request? Something like setting the modem-manager to notify the network-manager automatically when the first is on or execute a script instead..... like this one:


    # Script to enable Mobile Broadband 
    # Author: hanynowsky

    # Activate : nmcli con up id "Meditel 2"
    # Deactivate : nmcli con down id "Meditel 2"
    isModemOn=$(lsusb | grep modem\ on)

# Deactivating then Activating the broadband triggers the automatic connection
    if [ -n "${isModemOn}" ]; then
    nmcli nm wwan off #De activate mobile broadband
    nmcli nm wwan on # Activate mobile broadband
    else echo "Modem is off";

    exit 0;

I thought about adding a startup command : nmcli nm wwan on to enable broadband once my session is opened. This way, I get connected to Internet automatically. But I am afraid mobile broadband cannot be enabled unless there is a modem plugged in. Thanks

  • I think this script can solve the problem.. How to enable/disable mobile broadband from terminal?.
    – Web-E
    Apr 15 '13 at 4:43
  • 1
    @Web-E This isn't really a good script as it loops forever! yet, I am ging to try a better adaptation. could you put this comment as an answer so That I could mark it as accepted? Thanks
    – Hanynowsky
    Apr 17 '13 at 16:33
  • No need. I am marking as duplicate. You can upvote the orginal answer. :)
    – Web-E
    Apr 17 '13 at 16:56

This youtube video suggests an approach that I would consider using myself on Ubuntu 12.04 LTS

  • This is already done. The problem is not to set up a connection that automatically connects to Internet but triggering it when a modem is inserted and network is ready to receveive connections!
    – Hanynowsky
    Apr 15 '13 at 16:56

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