MM: How to get valid IP & network interface after successfully get connected

Aleksander Morgado aleksander at aleksander.es
Wed Sep 23 10:00:52 PDT 2015


On Wed, Sep 23, 2015 at 6:56 PM, Priyank Kumar <priyank.guddu at gmail.com> wrote:
> Thanks for prompt response,
> I used att information to make a bearer, I get ppp but I dont see any IP in
> ifconfig, neither the PPP network interface comes as ppp0, which normally
> comes in wvdial.
> So I am stuck there.
>
>
> mmcli -m 0
> --create-bearer="apn=wap.cingular,user=wap at cingulargprs.com,password=CINGULAR1,number=*99***1#"
> Successfully created new bearer in modem:
> /org/freedesktop/ModemManager1/Bearer/0
> priyank at priyank-desktop:/opt/crossbar/site-packages$ mmcli -b 0
> Bearer '/org/freedesktop/ModemManager1/Bearer/0'
>
> priyank at priyank-desktop:/opt/crossbar/site-packages$ mmcli -m 0 -c -b
> /org/freedesktop/ModemManager1/Bearer/0
> successfully connected the bearer
> priyank at priyank-desktop:/opt/crossbar/site-packages$ mmcli -b 0
> Bearer '/org/freedesktop/ModemManager1/Bearer/0'
>   -------------------------
>   Status             |   connected: 'yes'
>                      |   suspended: 'no'
>                      |   interface: 'ttyUSB0'
>                      |  IP timeout: '20'
>   -------------------------
>   Properties         |         apn: 'wap.cingular'
>                      |     roaming: 'allowed'
>                      |     IP type: 'none'
>                      |        user: 'wap at cingulargprs.com'
>                      |    password: 'CINGULAR1'
>                      |      number: '*99***1#'
>                      | Rm protocol: 'unknown'
>   -------------------------
>   IPv4 configuration |   method: 'ppp'
>   -------------------------
>   IPv6 configuration |   method: 'unknown'


Yes, that is because ModemManager won't launch pppd for you. It only
tells you that the newly created bearer is ready to run PPP on the
specified interface.
If you're using NetworkManager as well, NetworkManager would be
responsible for doing that. Otherwise, you'll need some other step in
your scripts (assuming you're scripting over mmcli) to run pppd
yourself.

The same will happen if the bearer tells you "dhcp" or "static". In
the former, you should launch a DHCP client yourself in the net
interface; in the latter, you should set the given
IP/netmask/gateway... yourself in the net interface.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list