Genymobile / gnirehtet

Gnirehtet provides reverse tethering for Android
Apache License 2.0
6.13k stars 565 forks source link

Network IPs and FTP #445

Open kukalikuk opened 2 years ago

kukalikuk commented 2 years ago

Hi @rom1v , first of all, thanks for your great work 👍 my issues, I run FTP server on my PC, while my tablet connected via gnirehtet-rust on that PC I'm able to access the FTP with my tablet using local IP of the server, which is great. But I'm unable to do the reverse, FTP server on my tablet can't be accessed by the same PC, that means android can connect to local IP but my PC can't connect to android's IP (10.0.0.2 in my case) How does the IP networking works in gnirehtet? FYI, gnirehtet VPN was the only connection while this happen, no other wifi/mobile connection in the tablet. Thanks

rom1v commented 2 years ago

FTP server on my tablet can't be accessed by the same PC, that means android can connect to local IP but my PC can't connect to android's IP (10.0.0.2 in my case)

Corrext. The tablet and pc are not on the same network, so the PC can't reach the tablet.

Only the tablet connections are forwarded to the PC.

How does the IP networking works in gnirehtet?

https://blog.rom1v.com/2017/03/introducing-gnirehtet/

Serphentas commented 2 years ago

My guess is that outgoing packets get properly NAT'd but when you try to go the other way around it's not going to work because the remote host has no idea how to reach your (new) subnet. Indeed, it will try via the default router instead of your computer, which will not work. You either have to specify the route inside the remote host's table or make your router send such packets to your computer, which will have to route them as well.