Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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:

    #!/bin/bash

    # 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";
    fi

    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

share|improve this question

marked as duplicate by Web-E, Mateo_, Eric Carvalho, Basharat Sialvi, AgentCool Apr 18 '13 at 5:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
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

1 Answer 1

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

share|improve this answer
    
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.