Quectel modem EC2x and m2m sim (apn for bidirectional public address)

Hello,
I would like to use the modem to remotely access a server running on our linux device (I use usbnet driver) but all the ports of public address are closed. The public address is pingable but cannot reach the running server.
Using the same m2m sim on a LTE router (which has the possibility to manage port forwarding) works…if I attach
a camera to that router , I can see the video stream remotely on the given public address (rtsp port).
Any help will be appreciated!
Thanks in advance

mc

Dear Mcdev,
Thanks for your inquiry in Quectel forum.
Could you hep to provide more inforamtion about your issue ? If you want to access your server which running on your Linux device, please make sure their IP address can be access via public network. Thanks!

Hi Kyson, thanks for your answer.
I am able to ping the public address of the modem network interface…

(get the ip of the device…infact if I turn off that address is immediately unaccessible)
root@imx8mm-var-dart:~# curl -s ‘https://ipinfo.io/ip
91.xx.xx.184

(from inside the linux device)
root@imx8mm-var-dart:~# ping 91.xx.xx.184
PING 91.xx.xx.184 (91.xx.xx.184) 56(84) bytes of data.
64 bytes from 91.xx.xx.184: icmp_seq=1 ttl=64 time=1.43 ms
64 bytes from 91.xx.xx.184: icmp_seq=2 ttl=64 time=1.31 ms


(from a windows PC)
E:>ping 91.xx.xx.184

Esecuzione di Ping 91.xx.xx.184 con 32 byte di dati:
Risposta da 91.xx.xx.184: byte=32 durata=533ms TTL=52
Risposta da 91.xx.xx.184: byte=32 durata=396ms TTL=52

Here the ifconfig output (usbnet modem => “usb0” ethernet device)…

usb0 Link encap:Ethernet HWaddr 7a:a6:46:c1:d0:8e
inet addr:192.168.225.42 Bcast:192.168.225.255 Mask:255.255.255.0
inet6 addr: fe80::de64:873f:f1c0:efc9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12771 errors:0 dropped:0 overruns:0 frame:0
TX packets:18239 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1187463 (1.1 MiB) TX bytes:1797229 (1.7 MiB)

However if I try to check device public ports…

( https://www.yougetsignal.com/tools/open-ports/ )

Port 21 is closed on 91.xx.xx.184.
Port 22 is closed on 91.xx.xx.184.

Best regards,
mc

other details…

( output of command “nslookup 91.xx.xx.184” )

Server: 192.168.225.1
Address 1: 192.168.225.1 mobileap.qualcomm.com

Name: 91.xx.xx.184
Address 1: 91.xx.xx.184

(output of netstat command…the ssh port 22 is open, the server is listening…)

tcp6 0 0 :::22 :::* LISTEN 1/init

(output of “ip route” command)

default via 192.168.225.1 dev usb0 proto dhcp metric 105
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.70 metric 104 linkdown
192.168.225.0/24 dev usb0 proto kernel scope link src 192.168.225.42 metric 105

Dear Mcdev,
Thanks for your updating.
Please confirm whether you can ping module from your PC. As you know that the module’s IP is 192.168.255.1 which is an internal network address, not a public address. So if you want to connect module and modem, please make sure they can ping normally. Thanks!

Hi Kyson,
yes, the modem internal address is pingable from the module itself…

root@imx8mm-var-dart:~# ifconfig

usb0 Link encap:Ethernet HWaddr 86:e2:d3:9e:9a:3f
inet addr:192.168.225.21 Bcast:192.168.225.255 Mask:255.255.255.0
inet6 addr: fe80::466e:b05e:8a99:ee41/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66 errors:0 dropped:0 overruns:0 frame:0
TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6289 (6.1 KiB) TX bytes:14571 (14.2 KiB)

root@imx8mm-var-dart:~# ping 192.168.225.21

PING 192.168.225.21 (192.168.225.21) 56(84) bytes of data.
64 bytes from 192.168.225.21: icmp_seq=1 ttl=64 time=0.109 ms
64 bytes from 192.168.225.21: icmp_seq=2 ttl=64 time=0.101 ms
64 bytes from 192.168.225.21: icmp_seq=3 ttl=64 time=0.100 ms

I tested also to ping the modem gateway ( 192.168.225.1 )…

(from “nmcli con show usb0”…)

IP4.ADDRESS[1]: 192.168.225.21/24
IP4.GATEWAY: 192.168.225.1
IP4.ROUTE[1]: dst = 0.0.0.0/0, nh = 192.168.225.1, mt = 102
IP4.ROUTE[2]: dst = 192.168.225.0/24, nh = 0.0.0.0, mt = 102
IP4.DNS[1]: 192.168.225.1

and it works…
root@imx8mm-var-dart:~# ping 192.168.225.1
PING 192.168.225.1 (192.168.225.1) 56(84) bytes of data.
64 bytes from 192.168.225.1: icmp_seq=1 ttl=64 time=1.42 ms
64 bytes from 192.168.225.1: icmp_seq=2 ttl=64 time=1.32 ms

Also if I test (from the module) a traceroute command, works…

root@imx8mm-var-dart:~# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 46 byte packets
1 192.168.225.1 (192.168.225.1) 1.290 ms 1.396 ms 1.993 ms
2 91.81.223.245 (91.81.223.245) 246.073 ms 98.861 ms 181.004 ms
3 10.133.42.29 (10.133.42.29) 28.966 ms 45.566 ms 23.833 ms
4 10.128.94.14 (10.128.94.14) 25.642 ms 69.330 ms 25.110 ms
5 10.128.94.236 (10.128.94.236) 25.718 ms 31.681 ms 25.556 ms
6 10.128.94.1 (10.128.94.1) 34.150 ms 32.534 ms 24.805 ms
7 83.224.40.185 (83.224.40.185) 25.587 ms 33.143 ms 22.956 ms
8 185.210.48.1 (185.210.48.1) 25.726 ms 79.003 ms 25.232 ms
9 * * *
10 dns.google (8.8.8.8) 26.093 ms 172.253.79.33 (172.253.79.33) 26.264 ms 216.239.49.181 (216.239.49.181) 49.392 ms

however seems not passing from the public address (in this case 91.xx.xx.11)

Update: yesterday I tested the EC25 modem (mounted on the evk) using a linux PC (lubuntu) and the result is the same…the public address is reachable , the ports are all closed.

Thanks, have a nice day.
BR

mc

UPDATE:
today I tested again the modem on a linux PC, and after creating a tcp server on a local port (8000) I suceeded to reach this socket from outside (a tcp client).
So the problem is the driver:
(using the same phisical modem)
-on an embedded linux, do not works
-on a linux PC (Lubuntu) works.

(linux embedded device , modem driver not working)===============

(ip addr show)
5: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fa:ff:85:ab:d2:8a brd ff:ff:ff:ff:ff:ff
inet 192.168.225.58/24 brd 192.168.225.255 scope global dynamic noprefixroute usb0
valid_lft 42538sec preferred_lft 42538sec
inet6 fe80::9c61:f02d:1e0c:10cd/64 scope link noprefixroute
valid_lft forever preferred_lft forever

(mmcli -m 0)

/org/freedesktop/ModemManager1/Modem/0 (device id ‘5f3bbd57dda899398d3776dbd58a24af9ec0c368’)

Hardware | manufacturer: ‘Quectel’
| model: ‘EC25’
| revision: ‘EC25EFAR06A06M4G’
| supported: ‘gsm-umts, lte’
| current: ‘gsm-umts, lte’
| equipment id: xxxxxxxxxxxxxx’

System | device: ‘/sys/devices/platform/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.1’
| drivers: ‘option1, cdc_ether’
| plugin: ‘Generic’
| primary port: ‘ttyUSB2’
| ports: ‘ttyUSB0 (qcdm), ttyUSB2 (at), ttyUSB3 (at), usb0 (net)’

Numbers | own : ‘unknown’

Status | lock: ‘none’
| unlock retries: ‘unknown’
| state: ‘disabled’
| power state: ‘on’
| access tech: ‘unknown’
| signal quality: ‘0’ (cached)

Modes | supported: ‘allowed: 2g, 3g, 4g; preferred: none’
| current: ‘allowed: 2g, 3g, 4g; preferred: none’

Bands | supported: ‘unknown’
| current: ‘unknown’

IP | supported: ‘ipv4, ipv6, ipv4v6’

3GPP | imei: ‘xxxxxxxxx’
| enabled locks: ‘none’
| operator id: ‘unknown’
| operator name: ‘unknown’
| subscription: ‘unknown’
| registration: ‘unknown’

SIM | path: ‘/org/freedesktop/ModemManager1/SIM/0’


Bearers | paths: ‘none’

(lubuntu linux PC , modem driver working)===============

(ip addr show)

44: enp0s26u1u5i4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether e2:17:72:0e:c8:8c brd ff:ff:ff:ff:ff:ff
45: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 3
link/ppp
inet 83.224.163.179/32 brd 83.224.163.179 scope global noprefixroute ppp0
valid_lft forever preferred_lft forever

(mmcli -m 4)
/org/freedesktop/ModemManager1/Modem/4 (device id ‘5f3bbd57dda899398d3776dbd58a24af9ec0c368’)

Hardware | manufacturer: ‘Quectel’
| model: ‘EC25’
| revision: ‘EC25EFAR06A06M4G’
| supported: ‘gsm-umts, lte’
| current: ‘gsm-umts, lte’
| equipment id: ‘xxxxxxxxxxxxxxxx’

System | device: ‘/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5’
| drivers: ‘option1, cdc_ether’
| plugin: ‘Generic’
| primary port: ‘ttyUSB2’
| ports: ‘ttyUSB0 (qcdm), enp0s26u1u5i4 (net), ttyUSB2 (at), ttyUSB3 (at)’

Numbers | own : ‘unknown’

Status | lock: ‘none’
| unlock retries: ‘unknown’
| state: ‘connected’
| power state: ‘on’
| access tech: ‘lte’
| signal quality: ‘80’ (recent)

Modes | supported: ‘allowed: 2g, 3g, 4g; preferred: none’
| current: ‘allowed: 2g, 3g, 4g; preferred: none’

Bands | supported: ‘unknown’
| current: ‘unknown’

IP | supported: ‘ipv4, ipv6, ipv4v6’

3GPP | imei: ‘xxxxxxxxxxxxxx’
| enabled locks: ‘none’
| operator id: ‘22210’
| operator name: ‘vodafone IT’
| subscription: ‘unknown’
| registration: ‘home’

SIM | path: ‘/org/freedesktop/ModemManager1/SIM/4’


Bearers | paths: ‘/org/freedesktop/ModemManager1/Bearer/5’

Thanks for your updating. If it is nor working in an embedded linux while working on a linux PC(Ubuntu), you may need to check the difference between them. Thanks!

Hi Kyson,
I finally succeed configuring EC25 , exposing the connection public address. In few words I use the ppp driver instead of cdc_ether driver, via the “wvdial” tool (that manages all the aspect of the connection enstablishment). The problem is that the ppp driver is a lot slower than cdc_ether driver (cdc_ether: 42.10 Mbit/s download , 23.25 Mbit/s on upload VS : 7.27 Mbit/s download 2.77 Mbit/s upload)…do you agree such results or do you think I am doing something wrong?

Best regards,
Alex

Thanks for your updating. For your testing, it is normal that ppp can obtain the public address, and cdc_ether also should can obtain the public address, if it can not, it is better to check you use which mode of module USB network card. You can use AT+QCFG=“usbnet” to check it. Normally, it should return 0. Thanks!

Hi Kyson,
AT+QCFG USBNET were set to 1 (ecm) it worked but now using 0 the connection is faster (6.15 Mbit upload) that is more than enough for our application.

Thanks a lot !
:smiley:

Best regards,
Alex

Thanks for your updating. We can close this topic now. Thanks!