10

How can I enable port forwarding during USB tethering?

I know there are plenty of apps available for this. but i want to know is there any method available to perform this without installing an app and also without rooting the device? Target machine is running with Android 4.0.4, obviously not rooted. Thank you.

P.S. I am trying to host a server on a PC connected to internet via Android device(USB tethered). I want my Android device to forward incoming TCP requests to particular port on the host machine.

2
  • Are you wanting to do this for development? You can forward ports using ADB by using adb forward tcp:6100 tcp:7100 (source). Also, could you update your question to include: what version of Android you're using, are you rooted, are you willing to root, what your objective is, and any other pertinent info that might help us help you. :)
    – filoxo
    Apr 1, 2014 at 0:34
  • @filoxo: This forward command enables forwarding of requests on a specific host port(PC) to a different port on an device. My requirement is exact opposite to it.
    – Kumar
    Apr 1, 2014 at 5:16

1 Answer 1

2

There are 2 adb commands:

adb forward
adb reverse

As you mentioned in the comment, you are probably looking for adb reverse which works like this:

adb reverse tcp:<remote> tcp:<local>

Where <remote> will be TCP port on your Android phone and <local> the TCP port on your host computer.

2
  • 1
    He mentioned he is using Android 4.0.4. adb reverse only works with Android 5+.
    – AndrewKS
    Feb 20, 2018 at 17:53
  • So how can I forward these ports to convert my PC to Server ? I want to forward ports 80, 21 and 3306
    – Ever Think
    Apr 30, 2018 at 13:00

You must log in to answer this question.

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