Connecting to internet ... as modem or as ecm?

Hello.

I need to connect my PC (with USB connected WP7502/wp7607) to the internet (private APN).

Should I follow pppd over modem route or is it possible also with ecm (ethernet over usb) route?

I am able to ssh@192.168.2.2 and have the chip connected to the internet. But how to use this connection from the PC? Some special legato command or script?

Regards.

maybe you have a look on this:

Thanks for info.

I will give it a try.

Just a question - in mangoH red documentation there is an information about starting module in HL or WP mode. Does it mean that WP7607 or WP7502 can be started in WP mode with all legato… stuff running and it can be configured with DIP switches to start in HL mode as dumb modem?

Regards.

i think it means you can put WP module or HL module into mangoh red board.

Commands which are in fx30 discussion probably should be put into a script and started, because I lost connectivity to module after iptables flush command. Or is such a command somewhere already prepared?

maybe you can skip the the iptables flush commands, or you can enter in UART console.

Sorry for basic question … how do I connect to module in UART console?

mangoh red board has a USB port which is connected to the UART of module.

I tried it with script.

But the result is just that I lost ssh connection and IP address of LTE isn’t propagated to PC.

I will try with UART port on mangoH red.

Hello.

So I managed to connect to UART as suggested.

This is the debugging result (I changed script you sent to have rmnet_data0 instead of rmnet0.

But still something is not working. What IP should I assign to PC ecm interface? I tried the same as was given to LTE, but it doesn’ work.

Regards.

root@swi-mdm9x28-wp:~# iptables -S
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT ACCEPT
-A FORWARD -i rmnet_data0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i usb0 -o rmnet_data0 -j ACCEPT
root@swi-mdm9x28-wp:~# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all – anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ifconfig
bridge0 Link encap:Ethernet HWaddr F2:DA:9B:D9:EC:50
inet addr:192.168.225.1 Bcast:192.168.225.255 Mask:255.255.255.0
inet6 addr: fe80::f0da:9bff:fed6:e94d%1127227260/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:76 (76.0 B)

ecm0 Link encap:Ethernet HWaddr 6A:84:E1:93:A6:61
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::6884:e1ff:fe93:a661%1127227260/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:101 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13628 (13.3 KiB) TX bytes:648 (648.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%1127227260/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

rmnet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING MTU:2000 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1152 (1.1 KiB) TX bytes:1464 (1.4 KiB)

rmnet_data0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.222.4 Mask:255.255.255.248
inet6 addr: fe80::204a:d8f4:53a1:6243%1127227260/64 Scope:Link
UP RUNNING MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1024 (1.0 KiB) TX bytes:1464 (1.4 KiB)

root@swi-mdm9x28-wp:~# cm data
Index: 1
APN: im.hdo
PDP Type: IPV4
Connected: yes
Auth type: PAP
User name: name
Password: passwd
Interface: rmnet_data0
Family[IPv4]: inet
IP[IPv4]: 192.168.222.4
Gateway[IPv4]: 192.168.222.5
Dns1[IPv4]: 185.103.144.3
Dns2[IPv4]: 194.228.175.185

probably in iptables should be used rmnet_data0 and ecm0. But I am not sure which should be the first and which should be the second.

Hello.

Now it works in one direction (from PC to internet), but the other direction is not working (from internet to PC).

I have public IP, so it should work (and works if I connect via pppd). From ifconfig statistics it seems that packets get to chip/legato, but is not forwarded to PC.

Regards.

I never tried this before but probably you need to try to write your iptable routing.