How to forward traffic from eth0 to ppp0 on Android
Hi, I am using Android 10 on a custom device. The Android image has been generated by AOSP.
I need to forward the traffico from the eth0 to the ppp0 (LTE module) interface.
I've managed to enable the ppp0 interface by using the pppd script (i.e.: `pppd call my-connection-info`) and I can see that I receive the two DNS server addresses and my public IPv4 successfully.
Now the first weird thing: If I ping to 220.127.116.11 I receive "connect: Network is unreachable" meanwhile if I specify the ppp0 interface with `ping -I ppp0 18.104.22.168` I can successfully ping the target.
Now I want to forward the eth0 traffic to the ppp0, to do so I've tried the following commands:
$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
But the PC on the other end of the eth0 interfce still prompts "From 192.168.10.1 icmp_seq=xxx Destination Net Unreachable" where 192.168.10.1 address is the Android device (which acts like a gateway).