1

I have a situation at home, the room where I have my desktop PC, router, printer, etc is being remodeled so I moved my PC to another room. Now the PC is far away from the router but it will be only for a couple of days. The PC do not have any WiFi adapter so I'm using my Android phone to share the Internet connection.

The problem is that I need to access the web server running in the desktop PC from others devices connected to the same router. I usually do it by using http://192.168.2.4 from the other devices. Obviously this does not work now.

Additional info that may be useful:

  • The PC running a web server has Linux Ubuntu 14.04 as OS.
  • This PC has adb installed. adb detects this phone.
  • This PC sees its own IP as 192.168.42.35, the url http://192.168.42.35 works but only from the same PC.
  • This PC, according to nmap, sees the Android phone as 192.168.42.129.
  • This PC can ping the others devices by the same IPs as before (192.168.2.x)
  • The others devices cannot reach this PC.
  • Router seems to have assigned 192.168.2.100 to the Android phone. The url http://192.168.2.100 does not connect to the web server. http://192.168.42.35 obviously does not work (from the other devices), but I tried anyway.

Update:

It seems I almost there. It's not perfect but, using an app called "Port Forwarder" seems possible. The only gotcha is that you cannot forward ports requiring root privileges (and my device isn't rooted anyway). So I will have to conform with 8080 to 80 mapping, but it's better than nothing.

I will share the steps needed to accomplish this If I success.

3
  • The way Android shares your internet connection is by acting as a modem. That way it creates a independent network with its own IP address pool. I think it's also not easy to pass a specific port through your phone to your PC.
    – GiantTree
    Jan 30, 2015 at 23:03
  • But is it possible to do at all? Maybe using adb to configure something in the phone? Jan 30, 2015 at 23:14
  • I know there is a way to do it, but I can't remember how to do it.
    – GiantTree
    Jan 30, 2015 at 23:23

1 Answer 1

1

The port forward app you mention won't port below 1024.

The app you require is TCP Port Fowarding. It is installed in Android. You can use it with USB adb to setup a VPN. It also is ran from user-space and root is not required.

2
  • I will try it and report back the results. Jan 31, 2015 at 10:20
  • Lamentably that app crash as soon as I tap on "Begin". The other "Port Forwarder" seems to do its job but for some reason connection to my web server is very unstable, the pages never finish loading. While internet browsing is ok. Jan 31, 2015 at 21:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .