Genymobile / gnirehtet

Gnirehtet provides reverse tethering for Android
Apache License 2.0
6.1k stars 564 forks source link

feature request / question #535

Open Rak3tenmann opened 2 months ago

Rak3tenmann commented 2 months ago

First of all: this works fantastic. Thanks for this peace of software. However, I need my android device only to access internal IPs and I would like to prevent the device to access the internet.

I am almost sure, there is an easy way to do so. But I don't know how. Thanks! Christian

rom1v commented 2 months ago

Maybe using a firewall which blocks connections from gnirehtet to internet?

Rak3tenmann commented 2 months ago

Sure, this would be easy. But the PC, who is the host for the Android System, need to connect to the internet. Only the Android-System need to be blocked. But this is invisible to the Firewall becaue it uses the PC. If I am not mistaking.

EDIT: Ahh - the SW Firewall in the Host System, you mean? This might be a good idea. Unfortunatly, this is a Windows System, and this is nothing I usualy work with. But I will try to find out if this might work. Let me know if you got some advise. Thx!

rom1v commented 2 months ago

Every connection initiated by the gnirehtet relay running on the computer are initiatdd by the device. So if you block all connections other than to your internal ips for the gnirehtet process (I don't know how to do that, but in principle), it should work.

Rak3tenmann commented 2 months ago

I have tried. Either I am too stupid to use the Windows firewall, or something like that is not provided.

EDIT: easier than expected. If you just block everything from gnirehtet.exe it works like I would have it. Because the PC which is the Host, is still available with this rule. Thank you! We may close this.