<div dir="ltr">
I need some help in establishing simultaneous interfaces to multiple APNs.<br><br>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.<br><br>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.<br><br>I tried three different things and none have brought happiness:<br><br>(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.<br><div><div><br></div><div>(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:</div><div style="margin-left:40px"><span style="font-family:monospace">error: couldn't connect the bearer: 'GDBusError: org.freedesktop.ModemManager1.Error.Core.NotFound: No valid data port to launch connection'</span></div><div><br></div><div>
(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. <br></div><div><br></div><div>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.<br></div><br>Ideas on how to accomplish what I am after?</div>

</div>