Setting up MangOH Red as Router to Cellular Gateway

I tried re running

sudo ifconfig commands you mentioned before
and got it to ssh into mangoh red
Screenshot from 2020-08-18 13-45-25

but why is this necessary, is there anyway I can fix the naming or reassign it its default IP address, so that I do not have to take extra steps to talk to it?

I think if I modify the LAN configuration per the steps above when running cfg_gateway.sh I may be able to fix the ssh issue (not sure just speculation). So I started to run it as normal and ran into this issue where it tries to bring up LAN eth0 and fails


Why could this be?

no idea as i don’t see problem:


root@swi-mdm9x28-wp:~# echo 2 > /sys/class/gpio/export
root@swi-mdm9x28-wp:~# echo out > /sys/class/gpio/gpio2/direction
root@swi-mdm9x28-wp:~# echo 1 > /sys/class/gpio/gpio2/value
root@swi-mdm9x28-wp:~# ./cfg_gateway.sh
MangOH gateway configuration
Enter WAN (cellular) interface (default: rmnet_data0): WAN interface rmnet_data0
Enter LAN interface (default: eth0):

LAN interface eth0
Enter LAN IP (default: 192.168.20.1): IP address (192.168.20.1)
Enter LAN Net Mask (default: 255.255.255.0):

net mask (255.255.255.0)
Mounting LAN interface ‘eth0’ IP: ‘192.168.20.1’, net mask: ‘255.255.255.0’
Check SIM inserted…
SIM card is inserted and unlocked (LE_SIM_READY).

Mounting the relay interface ‘rmnet_data0’…
Enabling the radio on ‘rmnet_data0’…
Radio power is already set to ON.
Enter APN (default: hkcsl): Enabling the data connection on ‘rmnet_data0’ using APN ‘hkcsl’…
Could not set APN ‘hkcsl’ for profile 1.
Maybe the profile is connectedCould not set PDP ‘IPV4’ for profile 1.
Maybe the profile is connectedChecking if device ‘rmnet_data0’ is up … ok
Routing inet … ok
mv: can’t remove ‘/etc/resolv.conf’: Device or resource busy
Testing connection … ok
Waiting for data connection on ‘rmnet_data0’…
Relay interface ‘rmnet_data0’ IP address is ‘10.102.45.194’
Cleaning IP tables…
Enabling IP forwarding…
net.ipv4.ip_forward = 1
Configuring the NAT…
Configure DHCP server (Y/n): Y

Enter start IP (default: 192.168.20.10): IP address (192.168.20.10)
Enter end IP (default: 192.168.20.100):

IP address (192.168.20.100)
Reconfiguring the DHCP server…
stopping DNS forwarder and DHCP server: dnsmasq… stopped /usr/bin/dnsmasq (pid 1334)
done.
Generating the configuration file ‘/tmp/dnsmasq.eth0.conf’ for the DHCP server…
Restarting the DHCP server…
starting DNS forwarder and DHCP server: dnsmasq… done.
MangOH gateway configuration completed
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ping 192.168.20.58
PING 192.168.20.58 (192.168.20.58): 56 data bytes
64 bytes from 192.168.20.58: seq=0 ttl=64 time=2.015 ms
64 bytes from 192.168.20.58: seq=1 ttl=64 time=1.778 ms
64 bytes from 192.168.20.58: seq=2 ttl=64 time=1.765 ms
^C
— 192.168.20.58 ping statistics —
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 1.765/1.852/2.015 ms


I see that you access cfg_gateway.sh from the main directory of your root device. I have this file placed in the /tmp folder, should this be in the main directory like yours?

I don’t think so, but you can give a try

Here is my output, I see that you have an APN of hkcsl and I have one of internet.sierrawireless.com after I set the apn to the default it does its own thing then fails to flush iptables, it says no chain/target to match by that name?

root@swi-mdm9x28-wp:~# cd /tmp
root@swi-mdm9x28-wp:/tmp# ls -l
-rwxr–r-- 1 root root 8495 Aug 18 21:40 cfg_gateway.sh
-rw-r–r-- 1 root root 237 Aug 18 19:43 hosts
-rw-r–r-- 1 root root 13757 Aug 18 19:43 ld.so.cache
-rw-r–r-- 1 root root 28 Aug 18 19:43 ld.so.conf
drwx-----x 2 root root 120 Jan 5 1980 legato
drwxrwxrwx 2 root root 60 Jan 5 1980 legato_logs
drwx------ 2 root root 80 Jan 5 1980 pkgdwl
drw-r–r-- 2 root root 60 Aug 18 19:43 psm_socket
srwx------ 1 root root 0 Jan 5 1980 sock0
srwxr-xr-x 1 root root 0 Jan 5 1980 thermal_engi_ipc
-rw-r–r-- 1 root root 0 Aug 18 21:43 tmpfdbtable.txt
root@swi-mdm9x28-wp:/tmp# ./cfg_gateway.sh
mangOH gateway configuration
Enter WAN (cellular) interface (default: rmnet_data0): rmnet_data0
WAN interface rmnet_data0
Enter LAN interface (default: eth0): eth0
LAN interface eth0
Enter LAN IP (default: 192.168.20.1): 192.168.20.1
IP address (192.168.20.1)
Enter LAN Net Mask (default: 255.255.255.0): 255.255.255.0
net mask (255.255.255.0)
Mounting LAN interface ‘eth0’ IP: ‘192.168.20.1’, net mask: ‘255.255.255.0’
Check SIM inserted…
SIM card is inserted and unlocked (LE_SIM_READY).

Mounting the relay interface ‘rmnet_data0’…
Enabling the radio on ‘rmnet_data0’…
Radio power is already set to ON.
Enter APN (default: internet.sierrawireless.com): internet.sierrawireless.com
Enabling the data connection on ‘rmnet_data0’ using APN ‘internet.sierrawireless.com’…
Setting up profile 1
Connecting … Waiting for data connection on ‘rmnet_data0’…
Relay interface ‘rmnet_data0’ IP address is ‘100.71.124.148’
ok
Checking if device ‘rmnet_data0’ is up … ok
Routing inet … ok
Updating /etc/resolv.conf … ok
Updating /etc/resolv.conf … ok
Testing connection … Cleaning IP tables…
iptables: No chain/target/match by that name.
Flush iptables failed
root@swi-mdm9x28-wp:/tmp#

seems you solved the eth0 problem.
I have no idea about your “No chain/target/match by that name”.
Here is my script, you can give a try.cfg_gateway.sh (8.2 KB)

@jyijyi
I tried using the cfg_gateway.sh file but the APN is not compatible with my network service provider. I did not get a Flush iptables failed error this time however I am getting a new error


I checked and this file is actually in the /usr/Sbin/ folder
I tried moving it to the /usr/bin folder however it says its a read-only file system
I then tried to change the directory in the cfg_gateway.sh file as such

and re-ran ./cfg_gateway.sh and now it is unable to find the LAN IP Address
Screenshot from 2020-08-20 14-59-24

I can see this file in my WP77 module FW R9.
root@fx30:~# ls /usr/bin/dns*
/usr/bin/dnsmasq

interesting. the FW revision I am using is rev. 13. should i be using rev 9?

Worth to givea try,

After trying to run the script I also have the problem that 192.168.2.2 is not reachable.
After running sudo ifconfig xxxxx up and sudo ifconfig xxxxx 192.168.2.3 it works again.

Unfortunately after every reset the problem is present again.

dconf reset -f / I have also tried, unfortunately without success

Does anyone else have an idea?
Thanks Reiner

Have you enabled network manager in your ubuntu?

Yes, the network manager is enabled

How about “sudo dhclient xxxxx”

without mangOH Red with WP7607

after connecting the mangOH Red to the USB

“sudo dhclient xxxx” nothing happens, after about 2min I aborted with ^C

after “sudo ifconfig enxfeb179cef435 192.168.2.3” it works again until I reboot the mangOH Red, I am confused :confused:

reboot

I don’t see problem, mayby it related to your PC

I don’t think the problem is with my PC. The same thing can be observed on 2 other PCs. Under Windows 10, the IP address is 169.254.xxx.xxx. xxx is reassigned after every reboot. Before I used the script, I always had 192.168.2.3.

I don’t see such problem

You might do a factory reset in fw r12

Thank you very much,
All is OK again
Reiner