CDC-ECM data connection failing

I have a Linux PC (Ubuntu 20.04 LTS) and WP7605 (devkit) connected with USB cable, and I am building an environment where I can connect to the internet from my Linux PC via CDC-ECM.

I referred to the following URL, but when I run ping 8.8.8.8 from Linux PC, it loses all packets.

The one difference from the above URL is that “iptables --flush” will not allow SSH connection from Linux PC to WP7605, so I skip this process only.

(Connecting to internet ... as modem or as ecm? - #6 by jyijyi - WP Series - Sierra Wireless Forum)

Currently, a good result include the following

  • I have confirmed that I can access WP7605 from a Linux PC via SSH 192.168.2.2 and ping 8.8.8.8 and ping www.google.com pass on that terminal

However, after configuring the “PC side:” in the URL above, all packets are lost when ping 8.8.8.8 is run.

Is there anything else I need to configure in order to get a successful USB CDC-ECM connection on the WP7605?

By the way, I am also thinking that there is no such thing as usb0 in the first place.

The reason is that when I ran “ifconfig -a” on both the Linux PC and on the WP7605, it did not find usb0.

For this reason, we also checked the environment in which the usb0 was replaced as follows, but the ping did not pass.

For “Fx30 side:”, usb0 was replaced with ecm0.

For the “PC side:”, usb0 was replaced with an I/F starting with enxXXXX.

As a result of “ifconfig -a”, 192.168.2.2 was assigned to ecm0 on WP7605, and 192.168.2.3 was assigned to enxXXXX on the Linux PC, so this setting was used.

In summary, the command executed to replace usb0 is as follows:

WP7605 side: (accessed from Linux PC via SSH 192.168.2.2)

echo > /etc/resolv.conf

cm data connect &

iptables -t nat -A POSTROUTING --out-interface rmnet0 -j MASQUERADE

iptables -A FORWARD -o ecm0 -i rmnet0 -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables -A FORWARD -i ecm0 -o rmnet0 -j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

cat /etc/resolv.conf

nameserver 110.163.0.5

nameserver 110.163.0.6

PC side: (Linux PC terminal)

sudo route add default gw 192.168.2.2 enxXXXX

sudo echo -e “nameserver 110.163.0.5\nnameserver 110.163.0.6” | sudo tee /etc/resolv.conf

Is there any mistake in this configuration?

Also, please let me know if there are any other settings that need to be made.

For WP77 or WP76 , the usb0 port needs to be changed to ecm0 port and rmnet0 needs to be changed to rmnet_data0

Hello jyijyi.
I am from the same team as 12214.

Following your advice we have tried the following but unfortunately the situation has not changed.
Are there any other settings that we need to do?

WP7605 side: (accessed from Linux PC via SSH 192.168.2.2)

root@swi-mdm9x28-wp:~# echo > /etc/resolv.conf 
root@swi-mdm9x28-wp:~# cm data connect &
root@swi-mdm9x28-wp:~# Checking if device 'rmnet_data0' is up ... ok
Routing inet ... ok
mv: can't remove '/etc/resolv.conf': Device or resource busy
Updating /etc/resolv.conf ... ok
Updating /etc/resolv.conf ... ok
Testing connection ... 
root@swi-mdm9x28-wp:~# iptables -t nat -A POSTROUTING --out-interface rmnet0_data0 -j MASQUERADE
root@swi-mdm9x28-wp:~# iptables -A FORWARD -o ecm0 -i rmnet0_data0 -m state --state RELATED,ESTABLISHED -j ACCEPT
root@swi-mdm9x28-wp:~# iptables -A FORWARD -i ecm0 -o rmnet0_data0 -j ACCEPT
root@swi-mdm9x28-wp:~# echo 1 > /proc/sys/net/ipv4/ip_forward
root@swi-mdm9x28-wp:~# cat /etc/resolv.conf 
nameserver 110.163.0.5
nameserver 110.163.0.6

PC side: (Linux PC terminal)

~$ ifconfig -a
enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether f0:de:f1:9a:89:96  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf2500000-f2520000  

enx7ac9c81ef9f5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.3  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::71c2:a55a:61fe:1e21  prefixlen 64  scopeid 0x20<link>
        ether 7a:c9:c8:1e:f9:f5  txqueuelen 1000  (Ethernet)
        RX packets 165  bytes 24732 (24.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 294  bytes 33560 (33.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 51510  bytes 3378878 (3.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 51510  bytes 3378878 (3.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 10:0b:a9:09:5f:94  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wwx2e868dba432f: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 2e:86:8d:ba:43:2f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

~$ sudo route add default gw 192.168.2.2 enx7ac9c81ef9f5
~$ sudo echo -e "nameserver 110.163.0.5\nnameserver 110.163.0.6" | sudo tee /etc/resolv.conf 
~$ ping www.google.com
ping: www.google.com: Temporary failure in name resolution
~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
334 packets transmitted, 0 received, 100% packet loss, time 340977ms

I have done the following testing which are working fine:

  1. WP7609 + FW R13.3.1 ( SWI9X07Y_02.28.03.05 ) + ThinkPad X220 Ubuntu 16.4.7 (disable networking) → OK
  2. WP7608 + FW R16.3 ( SWI9X07Y_02.37.06.05) + ThinkPad X220 Ubuntu 16.4.7 (disable networking) → OK
root@swi-mdm9x28-wp:~# cm data apn smartone
root@swi-mdm9x28-wp:~# cm data
Index:                         1
APN:                           smartone
PDP Type:                      IPV4
Connected:                     no
root@swi-mdm9x28-wp:~# cm radio
Power:                         ON
Current Network Operator:      SmarTone HK
Current RAT:                   LTE network (LE_MRC_RAT_LTE)
Status:                        Registered, home network (LE_MRC_REG_HOME)
Signal:                        Very strong signal strength (5)
PS:                            Packet Switched Registered, home network (LE_MRC_REG_HOME)

root@swi-mdm9x28-wp:~# cm data connect &
root@swi-mdm9x28-wp:~# Setting up profile 1
Connecting ... ok

root@swi-mdm9x28-wp:~# cm dChecking if device 'rmnet_data0' is up ... ok
aRouting inet ... tok
Updating /etc/resolv.conf ... ok
Updating /etc/resolv.conf ... ok
a
Index:                         1
APN:                           smartone
PDP Type:                      IPV4
Connected:                     yes
Interface:                     rmnet_data0
Family[IPv4]:                  inet
IP[IPv4]:                      10.171.93.89
Gateway[IPv4]:                 10.171.93.90
Dns1[IPv4]:                    10.30.23.133
Dns2[IPv4]:                    10.30.25.133
[1]+  Done                       cm data connect
root@swi-mdm9x28-wp:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=116 time=78.249 ms
64 bytes from 8.8.8.8: seq=1 ttl=116 time=47.055 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 47.055/62.652/78.249 ms
root@swi-mdm9x28-wp:~# iptables -F && iptables -I INPUT -j ACCEPT
root@swi-mdm9x28-wp:~# iptables -t nat -A POSTROUTING --out-interface rmnet_data
0 -j MASQUERADE
root@swi-mdm9x28-wp:~# iptables -A FORWARD -o ecm0 -i rmnet_data0 -m state --sta
te RELATED,ESTABLISHED -j ACCEPT
root@swi-mdm9x28-wp:~# iptables -A FORWARD -i ecm0 -o rmnet_data0 -j ACCEPT
root@swi-mdm9x28-wp:~# echo 1 > /proc/sys/net/ipv4/ip_forward
root@swi-mdm9x28-wp:~# cm info
Device:                        WP7608
IMEI:                          352913090512345
IMEISV:                        12
FSN:                           XG207430012345
Firmware Version:              SWI9X07Y_02.37.06.05 b15b59 jenkins 2022/09/27 07:54:33
Bootloader Version:            SWI9X07Y_02.37.06.05 b15b59 jenkins 2022/09/27 07:54:33
MCU Version:                   002.015
PRI Part Number (PN):          9908665
PRI Revision:                  001.002
Carrier PRI Name:              GENERIC
Carrier PRI Revision:          002.121_002
SKU:                           1104194
Last Reset Cause:              Reset, User Requested
Resets Count:                  Expected: 89     Unexpected: 0

On PC side, just type

sudo ifconfig usb0 192.168.2.3
sudo route add default gw 192.168.2.2 usb0
ping 8.8.8.8 -I usb0

Hello jyijyi.

Thanks to your support, I was finally able to connect to the Internet from my PC!
The reason I couldn’t connect was because of my typo. (I had to change rmnet0_data0 to rmnet_data0)

Sorry for the trouble.
Thank you so much.

oh yes, rmnet_data0 should be the network interface for cellular data connection

Good to hear that it is now working on your side!