Genymobile / gnirehtet

Gnirehtet provides reverse tethering for Android
Apache License 2.0
6.4k stars 587 forks source link

spacedesk doesn't work over gnirehtet #421

Open Riduidel opened 2 years ago

Riduidel commented 2 years ago

Like mentionned in #420 discussion, I want to use gnirehtet to establish an isolated network bewteen my Windows machine and my Android tablet to maximize resolution and response of that network screen when using spacedesk. So far, I'm able to use it to browse internet over USB (excellent thing!). Which demonstrates the "VPN" works. However, when trying to start spacedesk client, it never finds the server running on my Window machine. I suspected it was because server discovery relied upon UDP packets being sent by server or client, so, according to documentation, I set the server IP address in the client, but it didn't either work. And when checking the spacedesk server console, I can see no connection from client. What can I do to have that working ?

rom1v commented 2 years ago

However, when trying to start spacedesk client, it never finds the server running on my Window machine.

This is expected, the machines are not on the same LAN (even with gnirehtet).

I set the server IP address in the client, but it didn't either work

With the IP address, it should work.

If this is the same machine as where gnirehtet is running, you can access the host "localhost" using 10.0.2.2 from the Android device.

Riduidel commented 2 years ago

Well, strangely enough, even when I enter the 10.0.2.2 it never finds the server. Is there any Android app to "view" the network ?

rom1v commented 2 years ago

I don't know how spacedesk works to establish the connection.

Gnirehtet just allows the Android device to open a connection from the other end of the tunnel (i.e. from the computer).

Riduidel commented 2 years ago

So, I installed Net Analyzer from Google Play Store (ad-riden, but well). I then started gnirehtet and tried to see what was IP address of my tablet

Screenshot_20211210-161228_Network Analyzer

Which gave me a non-surprising 10.0.0.2. I'm a little more puzzled by the network mask ... Isn't the 255.255.255.255 supposed to preent any kind of access to local network?

Riduidel commented 2 years ago

Mind you, after that test, I successfully setup my tablet to use my freebox dns server at address 192.168.0.254. And this address legitimatally appears in Net Analyzer info screen.

Yang-Herman commented 2 years ago

I'll give you a way. I don't know why, but it works

  1. Connect the devices to the LAN
  2. Connect using spacedesk
  3. Disconnect the LAN
  4. You will find that spacedesk can still be used normally, which proves that the connection has been established
KiKiHUN1 commented 2 years ago

I tried moonlight and the 10.0.2.2 works great. S10+, android 11

bladyle commented 2 years ago

@Riduidel > Mind you, after that test, I successfully setup my tablet to use my freebox dns server at address 192.168.0.254. And this address legitimatally appears in Net Analyzer info screen. Can you share with more details how you manage to change the IP in Net Analyzer app?

NA0341 commented 2 months ago

@rom1v said:

This is expected, the machines are not on the same LAN (even with gnirehtet).

Deos that mean they are in a DCHP Subnet which runs on the Host Device (Desktop)?


PS: I created a Feature Request regarding Local IP Addresses for Clients: #554