Multiple APNs working at the same time

We need to work with more than one APN working at the same time and on the same 3G/4G modem or SIM. Will this be possible? Thanks.

No (that's not possible on any device) - but you can change APNs just like on any other device.

Thank you.

1 Like

Not true. This is very much possible with many common modems. Most (all?) MBIM modems support it and all newer QMI modems. You can only attach to one network of course, but often to as much as 8 APNs. Not that I think most people will have a use case for that :wink:

MBIM modems witll report "maxsessions" when asked about their capabilities. This one supports 8 APNs:

# umbim -p -d /dev/cdc-wdm0 caps
  devicetype: 0003 - remote
  cellularclass: 0001
  voiceclass: 0001 - no-voice
  simclass: 0002
  dataclass: 003C
  smscaps: 0003
  controlcaps: 0001
  maxsessions: 0008
  deviceid: 014582000xxxxxxx
  firmwareinfo: SWI9X30C_02.38.00.00
  hardwareinfo: EM7455

The modem module in the NR7101 supports 15(!):

# umbim -d /dev/cdc-wdm0 caps
  devicetype: 0001 - embedded
  cellularclass: 0001
  voiceclass: 0001 - no-voice
  simclass: 0002
  dataclass: 8000003C
  smscaps: 0003
  controlcaps: 0001
  maxsessions: 000F
  deviceid: 35435111001xxxx
  firmwareinfo: RG502QEAAAR11A07M4G
  hardwareinfo: RG502Q-EA

Some modem firmwares have an artificial restriction where the modem disconnects active sessions when you connect a new APN, even if the modem could support multiple APNs. I believe this is intended as a feature, assuming that users rather want to switch APNs than connect to multiple APNs.

For Sierra Wireless modems like the EM7455 this feature can be disabled by

AT!ENTERCND="A710"
AT!CUSTOM="SINGLEAPNSWITCH",0

Multi APN connections require IP session multiplexing. This is supported in the cdc_mbim driver using a weird VLAN to MBIM Session ID mapping, and in the qmi_wwan driver using the even weirder sysfs QMAP interface. It's also possible to use the rmnet driver on top of qmi_wwan in passthrough mode.

But I guess most users will want some tool to simply set up the muxing. The good news is that ModemManager can do this for you. Simply add "multiplex=requested" or "multiplex=required" to the mmcli --simple-connect parameter along with APN etc. The bad news is that this isn't integrated into the OpenWrt ModemManager scripts yet, AFAIK.

This is what I meant.

thanks for the reply

Hello, thank you very much for the help. I need to see the possible APN sections of my ZBTLink WE1326 device and I can't do it. Could they help? Should the command umbim -d /dev/cdc-wdm0 caps work for every machine? Thanks.

When placing the command umbim -d /dev/cdc-wdm0 caps the response I get is the following. Thanks.

image

Hi there,

I know this is an old post but I'm trying to achieve dual-stack IP by using multiple APNs in OpenWRT via ModemManager and MBIM.

I was able to successfully connect to 2 bearers by executing the following commands:

mmcli --simple-connect=apn=internet,ip-type=ipv4,multiplex=requested
mmcli --simple-connect=apn=internet,ip-type=ipv6,multiplex=requested

It then created 2 interfaces mbimmux0.1 and mbimmux0.2 but I'm not sure now how to move forward.
I tried to create an interface with protocol 'static' and pointed it to the generated mux interface but I am getting "Network device is not present".

Thanks in advance!

I believe modemmanager should create the mux interfaces automatically. What does

mmcl -b X

say, where X is the number of each bearer?

I didn't know you could create two different bearers for the same APN, BTW. But if it works, then it works...

I did use 2 different apns to connect to 2 bearers.

root@OpenWrt:~# mmcli -m 0 --simple-connect="apn=internet,ip-type=ipv4,multiplex=requested"
successfully connected the modem
root@OpenWrt:~# mmcli -m 0 --simple-connect="apn=smartbro,ip-type=ipv6,multiplex=requested"
successfully connected the modem

IPV4 Bearer

  ------------------------------------
  General            |           path: /org/freedesktop/ModemManager1/Bearer/5
                     |           type: default
  ------------------------------------
  Status             |      connected: yes
                     |      suspended: no
                     |    multiplexed: yes
                     |      interface: mbimmux0.1
                     |     ip timeout: 20
  ------------------------------------
  Properties         |            apn: internet
                     |        roaming: allowed
                     |        ip type: ipv4
  ------------------------------------
  IPv4 configuration |         method: static
                     |        address: 10.168.46.1
                     |         prefix: 30
                     |        gateway: 10.168.46.2
                     |            dns: 121.54.70.134, 121.54.70.132
                     |            mtu: 1500

IPV6 Bearer

  ------------------------------------
  General            |           path: /org/freedesktop/ModemManager1/Bearer/6
                     |           type: default
  ------------------------------------
  Status             |      connected: yes
                     |      suspended: no
                     |    multiplexed: yes
                     |      interface: mbimmux0.2
                     |     ip timeout: 20
  ------------------------------------
  Properties         |            apn: smartbro
                     |        roaming: allowed
                     |        ip type: ipv6
  ------------------------------------
  IPv6 configuration |         method: static
                     |        address: 2407:9800:1060:3cb:ad2b:463:488b:57f7
                     |         prefix: 64
                     |        gateway: 2407:9800:1060:3cb:c45c:6e07:453e:2419
                     |            dns: 2404:d800:3000::53:4, 2404:d800:3000::53:2
                     |            mtu: 1500

ip addr:

30: mbimmux0.1@wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether fa:1b:6b:f1:68:c2 brd ff:ff:ff:ff:ff:ff
31: mbimmux0.2@wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether fa:1b:6b:f1:68:c2 brd ff:ff:ff:ff:ff:ff

I saw an article that shows extra steps after creating the mux interfaces.

ip addr add 10.168.46.1/30 dev mbimmux0.1 then ip link set mbimmux0.1 up

However, I see error "Network device is not present"

In the device list, I see Software VLAN
image

Should I use a different proto for the mux interfaces? Thanks!

That should work.

My best guess is that luci and/or netifd is confused here. Maybe they think there should be a "mbimmux0" device?

Yes, that looks correct. The cdc_mbim driver maps VLAN subinterfaces to MBIM IP sessions, so "Software VLAN" is the expected type.

Tried to ping using ping 8.8.8.8 -I mbimmux0.1 but there is no response unfortunately.

I did see under devices that the base device points to mbimmux0

I tried to change the base device via uci uci set network.@device[1].ifname='wwan0'

Unfortunately, I now get a DEVICE_CLAIM_FAILED error.

I'm trying to create a custom modemmanager.sh proto script that will support dual-stack IP via multiplexing. It feels like I'm almost there, will do some further research.

@bmork I guess I'll use mbimcli instead.
I saw your post here https://lists.freedesktop.org/archives/modemmanager-devel/2016-September/003459.html.
This one seems to have worked.
I'll be modifying /lib/netifd/proto/mbim.sh so that it uses mbimcli instead of umbim as a workaround for now.