IP Forwarding on MangoH Red Board

The MangoH red Board has a IOT Wifi module from Mirage and able to get the WiFI up.

Is is possible for Host PC to access internet from the IOT Wifi Module of the MangoH red board connected to it?

Can you please share the steps ?

Above is the step to share cellular data rmnet0 to pc usb.
Maybe you can do the same but change the rmnet0 interface to wifi wlan0.

MangoH red board comes up as enp0s29xxx on ubuntu PC.

So these are the steps on MangoH red board.

Wifi is connected using wifi client app.
root@swi-mdm9x28-wp:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr F4:E1:1E:37:81:4F
inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2816 (2.7 KiB) TX bytes:2018 (1.9 KiB)

iptables --flush

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

iptables -A FORWARD -o usb0 -i wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables -A FORWARD -i usb0 -o wlan0 -j ACCEPT

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

On Ubuntu PC:

sudo route add default gw 192.168.2.2 enp0s29u1u4i19

Tried to Ping on Ubuntu PC, but get error “unknown host”

What is the ipaddress of enp0s29u1u4i19?

I suggest you sharing the cellular data to pc first to make sure everything is ok

i assign the ip address 192.168.2.3 to enp0s29u.

Is it mandatory to get the cellular data up on the Board ?

I have not inserted the sim card nor tested the cellular.

Just to make sure your setup is OK as the thread shows sharing cellular data to PC is OK.

i am able to get the cellular working.

Can you help me with steps for the wlan0 interface

You mean you can share cellular data to pc?

Log:

root@swi-mdm9x28-wp:~# cm radio
Power: ON
Current Network Operator: 404 86
Current RAT: LTE network (LE_MRC_RAT_LTE)
Status: Registered to a roaming network (LE_MRC_REG_ROAMING)
Signal: Very strong signal strength (5)
PS: Packet Switched Registered to a roaming network (LE_MRC_REG_ROAMING)

root@swi-mdm9x28-wp:~# ifconfig
bridge0 Link encap:Ethernet HWaddr 2A:ED:B3:4B:74:16
inet addr:192.168.225.1 Bcast:192.168.225.255 Mask:255.255.255.0
inet6 addr: fe80::28ed:b3ff:fe48:7113/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 BE:5E:29:E1:B4:62
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::bc5e:29ff:fee1:b462/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:213 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:38768 (37.8 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/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:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:608 (608.0 B) TX bytes:1674 (1.6 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:100.71.115.94 Mask:255.255.255.252
inet6 addr: fe80::caee:3244:f63e:6765/64 Scope:Link
UP RUNNING MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:576 (576.0 B) TX bytes:1674 (1.6 KiB)

root@swi-mdm9x28-wp:~# cm data
Index: 1
APN: internet.swir
PDP Type: IPV4V6
Connected: yes
Interface: rmnet_data0
Family[IPv4]: inet
IP[IPv4]: 100.71.115.94
Gateway[IPv4]: 100.71.115.93
Dns1[IPv4]: 8.8.8.8
Dns2[IPv4]: 4.2.2.2

Can you help me resolve the cellular issue. I cant even ping from the MangoH red board

You meam cannot ping google server?
Then you need to use other sim card

Used a working sim. But no luck.

Below are some logs and info:

root@swi-mdm9x28-wp:~# cm sim info
Type: EXTERNAL_SLOT_1
ICCID: 8991442459001821640
Home Network Operator: IDEA
EID:
IMSI: 404445900182164
Phone Number:
root@swi-mdm9x28-wp:~# cm data
Index: 1
APN: internet
PDP Type: IPV4V6
Connected: no
root@swi-mdm9x28-wp:~# cm data
Index: 1
APN: internet
PDP Type: IPV4V6
Connected: no
root@swi-mdm9x28-wp:~# ifconfig
bridge0 Link encap:Ethernet HWaddr BA:E4:53:62:19:46
inet addr:192.168.225.1 Bcast:192.168.225.255 Mask:255.255.255.0
inet6 addr: fe80::b8e4:53ff:fe5f:1643/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 E2:BD:65:87:94:12
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::e0bd:65ff:fe87:9412/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:172 errors:0 dropped:0 overruns:0 frame:0
TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:24513 (23.9 KiB) TX bytes:9404 (9.1 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:672 (672.0 B) TX bytes:672 (672.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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@swi-mdm9x28-wp:~# cm data connect
Setting up profile 1
Connecting … ok
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
Routing inet6 … ok
mv: can’t remove ‘/etc/resolv.conf’: Device or resource busy
Updating /etc/resolv.conf … ok
Updating /etc/resolv.conf … ok
Testing connection …
CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB0

You mean the module cannot ping google server?

I don’t see problem to share the wifi data to usb of PC.
After establish the WIFI connection, you can type the following:


root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# iptables -I INPUT -j ACCEPT
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# iptables -t nat -A POSTROUTING --out-interface wlan0 -j M
ASQUERADE
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# iptables -A FORWARD -o ecm0 -i wlan0 -m state --state REL
ATED,ESTABLISHED -j ACCEPT
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# iptables -A FORWARD -i ecm0 -o wlan0 -j ACCEPT
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# echo 1 > /proc/sys/net/ipv4/ip_forward
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cat /etc/resolv.conf
domain wifi.local
nameserver 8.8.8.8
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cm info
Device: WP7607-1
IMEI: 359780080500170
IMEISV: 6
FSN: V2842570321010
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenki[ 673.289132] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
ns 2019/05/21 03:33:04
[ 673.309584] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x3a MSTR_STS:0x0c1300c8 OPER:0x00000090
MCU Version: 002.011
PRI Part Number (PN): 9908645
PRI Revision: 001.001
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1104186
Last Reset Cause: Power Down
Resets Count: Expected: 33 Unexpected: 0
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr D0:B5:C2:F1:F5:5B
inet addr:192.168.23.253 Bcast:192.168.23.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4423 (4.3 KiB) TX bytes:7794 (7.6 KiB)


In PC side, type the following:

sudo ifconfig usb0 192.168.2.3
sudo route add default gw 192.168.2.2 usb0
sudo echo -e “nameserver 8.8.8.8” | sudo tee /etc/resolv.conf
ping www.google.com

Thank you for this. Able to connect from PC to the wlan0 of the MangoH Red board.

There were few steps missing when earlier i tried this.