How to do mobile broadband from command line

Yegor Yefremov yegorslists at googlemail.com
Fri Mar 14 03:34:50 PDT 2014


Hi Aleksander,

I have some questions regarding NetworkManager<->ModemManager integration.

1. how do I create a connection in nm, that is later referenced by its
id in "nmcli connection up"? I saw examples with "edit" command but nm
0.9.8.8 says: Error: 'con' command 'edit' is not valid.

2. nm invokes daemon() to detach from console, i,e. become a daemon in
the start scripts. Is this functionality planned for mm? Or should one
only use start-stop-daemon or alike?

Yegor

On Fri, Mar 14, 2014 at 12:14 AM, Eric Johnson <eric at minutekey.com> wrote:
> Hi Aleksander,
> Wow, that python script sounds awesome, if you have a chance to finish it.
>
> I'm going to try to get pppd going, next.  Then Verizon and DHCP or static
> IP I'm guessing.
> Thank!
> Eric
>
>
> On Thu, Mar 13, 2014 at 4:31 PM, Aleksander Morgado
> <aleksander at aleksander.es> wrote:
>>
>> Hey!
>>
>> On Thu, Mar 13, 2014 at 6:28 PM, Eric Johnson <eric at minutekey.com> wrote:
>> > [eric at linux-vn1z ~]$ mmcli -b 0
>> > Bearer '/org/freedesktop/ModemManager1/Bearer/0'
>> >   -------------------------
>> >   Status             |   connected: 'yes'
>> >                      |   suspended: 'no'
>> >                      |   interface: 'ttyUSB0'
>> >                      |  IP timeout: '20'
>> >   -------------------------
>> >   Properties         |         apn: 'none'
>> >                      |     roaming: 'allowed'
>> >                      |     IP type: 'none'
>> >                      |        user: 'none'
>> >                      |    password: 'none'
>> >                      |      number: '#777'
>> >                      | Rm protocol: 'unknown'
>> >   -------------------------
>> >   IPv4 configuration |   method: 'ppp'
>> >   -------------------------
>> >   IPv6 configuration |   method: 'unknown'
>> >
>> > [eric at linux-vn1z ~]$ mmcli -m 0 --list-bearers
>> >
>> > Found 1 bearers:
>> >
>> >     /org/freedesktop/ModemManager1/Bearer/0
>> >
>> > [eric at linux-vn1z ~]$ wvdialconf
>> > Editing `/etc/wvdial.conf'.
>> >
>> > Scanning your serial ports for a modem.
>>
>> Everything went ok until this point. So, mmcli lets you get the port
>> in connected state; that's how far ModemManager goes. Still, there is
>> another step that needs to be done, which is the IP setup in the data
>> port (which would usually be done by e.g. NetworkManager). There
>> currently are three main cases, and what you need to look at is the
>> Bearer properties that you get when MM tells you you're connected
>> (i.e. the "mmcli -b 0" output):
>>
>> Case 1) tty port
>> If the bearer tells you to use a tty as data port and use PPP, you
>> need to launch pppd on that tty, passing APN auth details among other
>> things.
>>
>> Case 2) net port, dhcp
>> If the bearer tells you to use a net port as data port and use DHCP,
>> you need to bring the interface up and launch a DHCP client in that
>> interface.
>>
>> Case 3) net port, static
>> If the bearer tells you to use a net port as data port and 'static'
>> config, it will also give you what IP address configuration (IP,
>> netmask..) you need to configure in the net port. So you'll need to
>> bring the interface up, and then setup those details in the interface.
>>
>> Interestingly, I was bored last Monday and started to write a python
>> app (called it 'mm-online', I'm no good inventing new names) which
>> will do exactly all that (just not using mmcli); it will use
>> libmm-glib via GObject-introspection to call SimpleConnect() and then
>> (this not yet done) prepare the connection following the steps I said
>> earlier. This would allow a 'standalone' operation of ModemManager
>> (i.e. without a higher level connection manager like NetworkManager).
>>
>>
>> --
>> Aleksander
>> https://aleksander.es
>
>
>
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
>


More information about the ModemManager-devel mailing list