Specifying bearer IPv4 method
Aleksander Morgado
aleksander at aleksander.es
Wed Jun 15 08:30:30 UTC 2022
Hey Tim,
> Upgraded from ModemManager 1.10 to 1.16, and discovered that the method which was previously used to set the BearerIpMethod (to Static/PPP/DHCP etc.) no longer exists. The missing method was named "set_method" and used to belong to the BearerIpConfig class (https://lazka.github.io/pgi-docs/ModemManager-1.0/classes/BearerIpConfig.html), but it is is no longer listed (at least, not via the Python bindings).
>
> Spent a while digging through the docs, but so far I'm unable to find where I can specify the IP method for a bearer. Any help appreciated!
>
That method was never meant to be exported in libmm-glib, so it makes
sense it's no longer available. If it was available before, it was a
bug. The reason for this is that the bearer IP config is created by
the ModemManager daemon and exposed in DBus, and so users of
libmm-glib can use MMBearerIpConfig to *read* the settings provided by
ModemManager.
The user selection of the IP type to use can be done either in
Simple.Connect() or in Modem.CreateBearer():
https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.CreateBearer
https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/gdbus-org.freedesktop.ModemManager1.Modem.Simple.html#gdbus-method-org-freedesktop-ModemManager1-Modem-Simple.Connect
In libmm-glib there are helper types for those as well, see
MMBearerProperties and MMSimpleConnectProperties:
https://www.freedesktop.org/software/ModemManager/doc/latest/libmm-glib/MMBearerProperties.html
https://www.freedesktop.org/software/ModemManager/doc/latest/libmm-glib/MMSimpleConnectProperties.html
The user will select IP type to use in either MMBearerProperties or
MMSimpleConnectProperties and then MM will expose which one was agreed
with the network in the read-only MMBearerIpConfig. They may be
different only if user selected IPv4v6, because we won't fail a
connection attempt if we cannot get dual-stack (e.g. we may get IPv4
only even if we requested IPv4v6).
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list