Hello, I have a Sierra Wireless EM9191 in MBIM mode and I would like to set IP passthrough to pass the public IPv4 or IPv6 address through to the connected device instead of the DHCP 192.0.0.2 address. Is this possible with AT commands?
I remember after using mbim-network command, my host PC can get the same IP address in wwan0 as the EM91 module’s IP address in AT+CGPADDR=1
owner@CNHKG-EX-001367:~/legato/workspace/git/mangOH_2-7-2019$ cat /etc/mbim-network.conf
APN=hkcsl
APN_USER=
APN_PASS=
APN_AUTH=
PROXY=yes
owner@CNHKG-EX-001367:~/legato/workspace/git/mangOH_2-7-2019$sudo mbim-network /dev/cdc-wdm0 start
Loading profile...
APN: hkcsl
Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close'...
[/dev/cdc-wdm0] Subscriber ready status retrieved: Ready state: 'initialized' Subscriber ID: '454003074112345' SIM ICCID: '8985200012741123457' Ready info: 'unknown' Telephone numbers: (0) 'unknown' [/dev/cdc-wdm0] Session not closed: TRID: '3'
Saving state... (TRID: 3)
Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --no-open=3 --no-close'...
[/dev/cdc-wdm0] Registration status: Network error: 'unknown' Register state: 'home' Register mode: 'automatic' Available data classes: 'lte' Current cellular class: 'gsm' Provider ID: '45400' Provider name: '1O1O' Roaming text: 'unknown' Registration flags: 'unknown' [/dev/cdc-wdm0] Session not closed: TRID: '4'
Saving state... (TRID: 4)
Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open=4 --no-close'...
Saving state... (TRID: 5)
Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect=hkcsl --no-open=5 --no-close'...
Network started successfully
Saving state... (TRID: 6)
> sudo mbim-network /dev/cdc-wdm0 start ✔
Loading profile at /etc/mbim-network.conf...
APN: fast.t-mobile.com
APN auth protocol: unset
APN user: unset
APN password: unset
mbim-proxy: yes
Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --device-open-proxy'...
[/dev/cdc-wdm0] Subscriber ready status retrieved: Ready state: 'initialized' Subscriber ID: '310260401661179' SIM ICCID: '8901260408716611794F' Ready info: 'none' Telephone numbers: (1) '17343856223' Flags: 'sim-removable'
Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --device-open-proxy'...
[/dev/cdc-wdm0] Registration status: Network error: 'none' Register state: 'home' Register mode: 'automatic' Available data classes: '5g-nsa' Current cellular class: 'gsm' Provider ID: '310260' Provider name: 'T-Mobile' Roaming text: 'unknown' Registration flags: 'packet-service-automatic-attach' Preferred data classes: '5g-nsa'
Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --device-open-proxy'...
[/dev/cdc-wdm0] Successfully attached to packet service [/dev/cdc-wdm0] Packet service status: Network error: 'none' Packet service state: 'attached' Available data classes: '5g' Uplink speed: '1200000000 bps' Downlink speed: '3200000000 bps' Frequency range: '1' Data sub class: '5g-nr' TAI PLMN MCC: '136' TAI PLMN MNC: '104' TAI TAC: '10942208'
Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect=apn='fast.t-mobile.com' --device-open-proxy'...
warning: key 'apn' is deprecated, use 'access-string' instead
Network started successfully
> ip a
<SNIP>
wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether ea:59:bf:74:cf:85 brd ff:ff:ff:ff:ff:ff
Then when I run:
> sudo dhclient wwan0
I get:
> ip a
<SNIP>
wwan0: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1472 qdisc fq_codel state UNKNOWN group default qlen 1000
link/ether ea:59:bf:74:cf:85 brd ff:ff:ff:ff:ff:ff
inet 192.0.0.2/27 brd 192.0.0.31 scope global dynamic wwan0
valid_lft 7200sec preferred_lft 7200sec
inet6 2607:fb91:179e:472f:e859:bfff:fe74:cf85/64 scope global dynamic mngtmpaddr proto kernel_ra
valid_lft forever preferred_lft forever
inet6 fe80::e859:bfff:fe74:cf85/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
Did you use a different set of commands?
Thanks!
what is the return of the AT+CGPADDR=1 for the IP address obtained on module side?
Output:
+CGPADDR: 1,38.7.251.145.23.158.71.47.10.211.232.87.178.245.206.17
so module is obtaining only the IPV6 address?
How about if you set the AT+CGDCONT=1,"IP","fast.t-mobile.com"
which forces to be IPV4?
AT+CGDCONT=1,"IP" "fast.t-mobile.com"
OK
AT+CGPADDR=1
+CGPADDR: 1,38.7.251.145.23.158.71.47.10.211.232.87.178.245.206.17
Do I need to do anything after the CGDCONT
command as it appears to give the same results?
have you power reset the module?
Not since issuing the command. I will now.
Same results from the power cycle.
what is the return of AT+CGPADDR=1?
Still IPV6?
That command is just giving “ERROR”
what is the return of AT!GSTATUS? then?
I got +CGPADDR: 1,0.0.0.0
to return from AT+CGPADDR=1
My AT!GSTATUS?
is as follows:
!GSTATUS:
Current Time: 63 Temperature: 21
Thermal Mitigation Level: 0
Reset Counter: 1 Mode: ONLINE
AT!GSTATUS?
!GSTATUS:
Current Time: 89 Temperature: 22
Thermal Mitigation Level: 0
Reset Counter: 1 Mode: ONLINE
System mode: NR5G PS state: Attached
IMS reg state: UNKNOWN IMS mode: Not Support
IMS Srv State: UNKNOWN SMS,UNKNOWN VoIP
NR5G TAC: a6f700 NR5G Cell ID: 436
NR5G band: n41 NR5G Carrier ID: 0
NR5G dl bw: 20 MHz NR5G ul bw: Unknown
NR5G Tx Power: — NR5G Tx chan: 0
NR5G Rx chan: 520008
NR5G dl MIMO: 0 NR5G ul MIMO: 0
NR5G(sub6) RxM RSSI (dBm): -61.0 NR5G(sub6) RxD RSSI (dBm): -65.0
NR5G(sub6) RxM1 RSSI (dBm): — NR5G(sub6) RxD1 RSSI (dBm): —
NR5G RSRP (dBm): -89 NR5G RSRQ (dB): -11
NR5G SINR (dB): 20.0
OK
AT+CGPADDR=1
+CGPADDR: 1,38.7.251.145.23.157.1.87.10.211.232.87.79.210.198.99
OK
AT+CGACT=1,1
+CME ERROR: unknown
It appears to be assigning the public IP as the IPv6 then using NAT on the IPv4? But hard to confirm as I am having trouble communicating with the IPv6 address from other networks to see if it’s reachable.
Doing some research my ISP T-Mobile, does not seem to use IPv4 on their cellular network hence why no IPv4. The IPv6 address assigned is the public address.
Actually why your host platform cannot use DHCP 192.0.0.2 address?
Is there any connection problem now?
The address works, I never had a connection issue going out. I’m attempting to host a service over the public IP address and IPv4 is significantly easier to use as IPv6 direct routing has poor support but looks like I cannot force IPv4 on this cellular provider so will have to make do.