Help in establishing multiple simultaneous APNs

Riff Rafferty rafferty8933 at gmail.com
Thu Mar 17 01:51:10 UTC 2022


I have created a new Ubuntu system to try out the suggestions made by
Aleksander in attempts to obtain multiple simultaneous connections to
different APNs. My new Ubuntu installation is based on a development
release of Ubuntu 22.04 (Jammy Jellyfish). The mmcli reports it is version
1.18.6 and the nmcli says version 1.36.0.  The mbimcli is not installed.

I edited the file /lib/system/system/ModemManager.service file so that the
ExecStart line was as follows:

ExecStart=/usr/sbin/ModemManager --debug --test-multiplex-requested



I rebooted the Ubuntu system and tried two of the three approaches detailed
in my prior email in this thread:

(a) Using the create/connect bearer features of mmcli

(b) Rebooting and then trying multiple connection keyfiles with nmcli



Neither one of these approaches gave me satisfaction. In short, here are
the results:

(a) A sequence of mmcli commands to create a bearer, connect the bearer,
create a second bearer, then connect the second bearer did result in
multiple simultaneous packet data network connections. Some subsequent
configuration with ip and route commands were necessary to make it work,
but the second connection failed after a few minutes with error
org.freedesktop.ModemManager1.Error.MobileEquipment.Unknown.

(b) This sequence of commands (sudo nmcli con reload, sudo nmcli --wait 300
con up id conn1,  sudo nmcli --wait 300 con up id conn2) did not produce
multiple simultaneous packet data network connections, but rather the
second connection displaced the first.



I would like to provide plenty of details about the experiences, so I’m
going to make follow-on postings to this one. This will allow others to
give me further suggestions on the specific steps in the approaches.

On Fri, Mar 4, 2022 at 9:43 AM Aleksander Morgado <aleksander at aleksander.es>
wrote:

> Hey,
>
> > I need some help in establishing simultaneous interfaces to multiple
> APNs.
> >
> > I have an Ubuntu 20.04 system with a single cellular modem attached via
> USB in an IoT application. My problem is that I need to drive traffic
> through two different APNs when registered to the same cellular network.
> Each APN serves a different purpose -- different services with different
> billing are to occur on each.
> >
> > I've tried multiple ways to do this. While I can get connected with two
> APNs, I can only get an interface name for one of the connections. I need a
> separate interface name for each so that I can place the respective flow of
> traffic through the appropriate interface and onto the correct APN. My
> application needs both to be available simultaneously. Going back and forth
> between building up and tearing down each of them is not an acceptable
> solution.
> >
> > I tried three different things and none have brought happiness:
> >
> > (1) Using mmcli in debug mode with a set of AT commands for each APN:
> using the sequence AT+GDCONT, AT+XGAUTH, and AT+CGACT with parameters
> relevant for the first APN and then again with the sequence AT+GDCONT,
> AT+XGAUTH, and AT+CGACT for the second APN. This is successful, and I
> obtain assigned IP addresses for each APN. However, neither of the APNs are
> assigned to an interface and I don't know how to funnel traffic to each.
> >
> > (2) I have used the bearer features of mmcli. I have run "mmcli -m
> <modem-number> --create-bearer=<key-value pairs>" two times, each with the
> proper key-value pairs for the respective APNs. When I later run "mmcli -m
> <modem_number>", I see both bearers. I then run "mmcli -m <modem-number>
> --bearer <bearer-number> --connect". This works the first time for the
> first APN/bearer, and I have an interface assigned. But I get the following
> error when next running " mmcli -m <modem-number> --bearer <bearer-number>
> --connect" for the second APN/bearer:
> > error: couldn't connect the bearer: 'GDBusError:
> org.freedesktop.ModemManager1.Error.Core.NotFound: No valid data port to
> launch connection'
> >
> > (3) I've put multiple connection keyfiles in the
> /etc/NetworkManager/system-connections directory. I run "nmcli con reload"
> and then "nmcli --wait 120 con up id <name_of_first_connection>". This
> works as I get connected to the first APN, get assigned an IP address, and
> get an interface association (wwan0). However, when I run "nmcli --wait 120
> con up id <name_of_second_connection>", this works, but it displaces the
> first connection, so I am only left with the second connection on interface
> wwan0. The first connection is no longer available.
> >
> > My Ubuntu 20.04 system has mmcli 1.16.6 and nmcli 1.22.10. I could also
> install mbimcli 1.24.8, although it is not currently part of the system
> image.
> >
> > Ideas on how to accomplish what I am after?
>
> Your modem needs to be QMI or MBIM based, and you need to install
> ModemManager 1.18, which is the first version supporting multiplexing.
> Once you have that, you can:
>  *  run Modem.SimpleConnect() with"multiplex=required"
> Or:
>  * start the ModemManager daemon with the additional
> --test-multiplex-requested option.
>
> My suggestion is to use the 2nd option, just start MM with
> --test-multiplex-requested so that any attempt to start a connection
> (e.g. via NetworkManager) will trigger the multiplex setup. When
> running with multiplex enabled, ModemManager will create a new virtual
> network interface for each APN connection, and then you can handle
> custom routing rules in the host for each of them.
>
> I talked a bit about this feature in the FOSDEM2022 talk earlier this
> year, if you're interested:
> https://fosdem.org/2022/schedule/event/mobile_modemmanager/
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20220316/03d3b007/attachment.htm>


More information about the ModemManager-devel mailing list