6

Is there a way to do WiFi tethering on my Android and do port forwarding for my PC from the Android.

What I mean is:

  • Internet --> Android
  • Android has the port forwarding to PC (XAMPP)

  • PC running XAMPP --> Android

  • Android --> Internet

I'm trying to see if I can get a server running from my PC being able to be accessed from the internet using my Android.

Is there any way to do that?

Canadian Luke
  • 24,199
  • 39
  • 117
  • 171
johnny
  • 61
  • 1
  • 1
  • 2

4 Answers4

0

If you run iptables -L in Android then you can see that the FORWARD Chain has a DROP policy. This means it can't forward the packets from the internet to your pc.

If your Android is rooted then you can install AFWall+.

In that tick WiFi and DATA box for DHCP and DNS services entry from the list. Then option->enable firewall.

Burgi
  • 6,493
  • 14
  • 39
  • 52
kaushikC
  • 65
  • 1
  • 8
0
  1. Open port forwarding in router

  2. Set DMZ Address

Set ports as [Computer IP:Normal Port] - - - - [DMZ_IP:Different port to internet]

So if for whatever reason im sharing on port 80.

Then its [192.168.0.5:80] - - - - [172.123.132.158:8080]

80 to 8080

My webserver is on [192.168.0.5:80] or [127.0.0.1:80].

But my android will connect [172.123.132.158:8080]

TardisGuy
  • 472
  • 3
  • 18
0

Depending on your cell service provider, many of them block ports such as HTTP, HTTPS, FTP, SMB, POP/SMTP/IMAP, etc (as a server) on their cell phones. I would first check with them to see if they even allow those through their cell network, even with different port numbers assigned. Having said that...

If the device is rooted, and you have access to the terminal, you should be able to use some *nix wizardry to do so. Short of that, I woulnd't know exactly what app would allow you to do so

Canadian Luke
  • 24,199
  • 39
  • 117
  • 171
  • 2
    @johnny Mobile ISPs tend to use private IP addresses for phones. You can check this in `Settings / About Phone / Status` and look at the IP address entry. If it is a private (10.x 192.168.x 172.16.x) address, nothing will work. – Paul Mar 06 '13 at 02:29
  • @Paul Is what you're describing have anything to do with double NAT? Like CG-NAT? Thus users getting a private IP address? Thank you in advance. – Shayan Aug 11 '19 at 07:25
  • Also what if the carrier provides IPv4/IPv6 dual stack?? Does it help? – Shayan Aug 11 '19 at 07:28
  • 1
    @Shayan Double NAT is where both the source and destination IP addresses are NATted. Mobiles just use source IP NATting (CG-NAT is just this at a big scale) so they can use many private IP addresses behind a single public IP. This is for outgoing connections. "Port-Forwarding" is destination IP NAT, and is used for incoming connections. – Paul Aug 13 '19 at 06:16
  • 1
    If the carrier provides IPv6 *and* this is actually routed on the internet *and* they don't have incoming restrictions, then it should work. But you need IPv6 from the source all the way through, or a IPv4->IPv6 broker somewhere. This stuff is just unlikely because there isn't much reason to build out and secure the capability when there going to be a very small amount of people using it. – Paul Aug 13 '19 at 06:18
-1

You can easily use internet though an Android PC Suit. The PC Suit is a software that helps users to connect their android with PC and you can share the data and also use internet from your android device.