Hi Peng,
Thanks a lot for support, We are able to copy 'scp' from root cell to inmate cell.
Basically we want to keep our E-call application with MQTT on Inmate cell side.
We are able to share read/write Shared memory from root to inmate cell. Also, we are able to give static IP to root/inmate cell as proposed by you.
Now we need an internet connection on inmate cell, for transmitting received data from root cell, to cloud.
We connected Quectel EC25 module to NXP i.MX8MQ board via USB port.
IFCONFIG on Root cell data:
"
ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC> mtu 1500
ether 00:04:9f:05:a5:9c 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
eth1: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 16384
inet 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::88f0:a7ff:fe40:2407 prefixlen 64 scopeid 0x20<link>
ether 8a:f0:a7:40:24:07 txqueuelen 1000 (Ethernet)
RX packets 41 bytes 7030 (6.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 71 bytes 18812 (18.3 KiB)
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 103 bytes 9268 (9.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 103 bytes 9268 (9.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet 192.168.225.39 netmask 255.255.255.0 broadcast 192.168.225.255
inet6 2401:4900:4bb5:e7a7:609f:c3ff:fe2c:903b prefixlen 64 scopeid 0x0<global>
inet6 fe80::609f:c3ff:fe2c:903b prefixlen 64 scopeid 0x20<link>
ether 62:9f:c3:2c:90:3b txqueuelen 1000 (Ethernet)
RX packets 84 bytes 7614 (7.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 117 bytes 13860 (13.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
"
As you can see Internet connection is established on ROOT cell side.
Below is PING command output
"
root@imx8mqevk:/home ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=114 time=193 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=114 time=68.9 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=114 time=62.8 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=114 time=68.5 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=114 time=66.5 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=114 time=78.6 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=114 time=71.0 ms
"
Now I am facing internet issue on Inmate cell, below if IFCONFIG log:
"
root@imx8mqevk:~ ifconfig
eth0 Link encap:Ethernet HWaddr 6E:58:98:59:01:A0
inet addr:192.168.0.4 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6c58:98ff:fe59:1a0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:16384 Metric:1
RX packets:184 errors:0 dropped:0 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:78814 (76.9 KiB) TX bytes:14002 (13.6 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:22 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:3897 (3.8 KiB) TX bytes:3897 (3.8 KiB)
"
ALSO we tried :IP Forwarding on ROOT cell side:
To allow the inmate cell having external network access:
In root cell
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth1 -o usb0 -j ACCEPT
iptables -A FORWARD -i usb0 -o eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
"
When I run above commands, I get below logs:
"
root@imx8mqevk:/home iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
[ 1869.738194] audit: type=1325 audit(1755848821.593:11): table=nat family=2 entries=7 op=xt_replace pid=713 comm="iptables"
root@imx8mqevk:/home [ 1869.749806] audit: type=1300 audit(1755848821.593:11): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaafd66a400 items=0 ppid=607 pid=713 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 1869.779649] audit: type=1327 audit(1755848821.593:11): proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0075736230002D6A004D415351554552414445"
"
Also putting Dmesg log from root cell
"
[ 71.141601] Created Jailhouse cell "ecall-linux-inmate-demo"
[ 77.822386] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 206.451703] audit: type=1325 audit(1755847158.198:4): table=nat family=2 entries=0 op=xt_register pid=651 comm="iptables"
[ 206.463131] audit: type=1300 audit(1755847158.198:4): arch=c00000b7 syscall=209 success=yes exit=0 a0=4 a1=0 a2=40 a3=ffffe78d01c0 items=0 ppid=607 pid=651 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 206.493176] audit: type=1327 audit(1755847158.198:4): proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0065746830002D6A004D415351554552414445
[ 206.508268] audit: type=1325 audit(1755847158.202:5): table=nat family=2 entries=5 op=xt_replace pid=651 comm="iptables"
[ 206.519201] audit: type=1300 audit(1755847158.202:5): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaabb51c230 items=0 ppid=607 pid=651 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 206.547353] audit: type=1327 audit(1755847158.202:5): proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0065746830002D6A004D415351554552414445
[ 217.506636] audit: type=1325 audit(1755847169.257:6): table=nat family=2 entries=6 op=xt_replace pid=657 comm="iptables"
[ 217.517791] audit: type=1300 audit(1755847169.257:6): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaaec783230 items=0 ppid=607 pid=657 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 217.547639] audit: type=1327 audit(1755847169.257:6): proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0075736230002D6A004D415351554552414445
[ 294.389911] audit: type=1325 audit(1755847246.146:7): table=filter family=2 entries=0 op=xt_register pid=659 comm="iptables"
[ 294.401564] audit: type=1300 audit(1755847246.146:7): arch=c00000b7 syscall=209 success=yes exit=0 a0=4 a1=0 a2=40 a3=fffff5707410 items=0 ppid=607 pid=659 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 294.431369] audit: type=1327 audit(1755847246.146:7): proctitle=69707461626C6573002D4100464F5257415244002D690065746831002D6F0075736230002D6A00414343455054
[ 294.445250] audit: type=1325 audit(1755847246.150:8): table=filter family=2 entries=4 op=xt_replace pid=659 comm="iptables"
[ 294.456430] audit: type=1300 audit(1755847246.150:8): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaaeb8d3950 items=0 ppid=607 pid=659 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 294.484541] audit: type=1327 audit(1755847246.150:8): proctitle=69707461626C6573002D4100464F5257415244002D690065746831002D6F0075736230002D6A00414343455054
[ 314.598783] audit: type=1325 audit(1755847266.267:9): table=filter family=2 entries=5 op=xt_replace pid=662 comm="iptables"
[ 314.610726] audit: type=1300 audit(1755847266.267:9): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaac05eaac0 items=0 ppid=607 pid=662 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 314.640305] audit: type=1327 audit(1755847266.267:9): proctitle=69707461626C6573002D4100464F5257415244002D690075736230002D6F0065746831002D6A00414343455054
[ 849.488680] audit: type=1006 audit(1755847801.267:10): pid=671 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=3 res=1
[ 849.501588] audit: type=1300 audit(1755847801.267:10): arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=ffffc0aa76a0 a2=1 a3=ffff83653020 items=0 ppid=238 pid=671 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=3 comm="crond" exe="/usr/sbin/crond" key=(null)
[ 849.527425] audit: type=1327 audit(1755847801.267:10): proctitle=2F7573722F7362696E2F63726F6E64002D6E
[ 1869.738194] audit: type=1325 audit(1755848821.593:11): table=nat family=2 entries=7 op=xt_replace pid=713 comm="iptables"
[ 1869.749806] audit: type=1300 audit(1755848821.593:11): arch=c00000b7 syscall=208 success=yes exit=0 a0=4 a1=0 a2=40 a3=aaaafd66a400 items=0 ppid=607 pid=713 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttymxc0 ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[ 1869.779649] audit: type=1327 audit(1755848821.593:11): proctitle=69707461626C6573002D74006E6174002D4100504F5354524F5554494E47002D6F0075736230002D6A004D415351554552414445
"
CAN YOU help us in resolving above Internet issue on Inmate cell?