7

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.

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • 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 '14 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 '14 at 5:16
0

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.

  • He mentioned he is using Android 4.0.4. adb reverse only works with Android 5+. – AndrewKS Feb 20 '18 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 – Ragesh D Antony Apr 30 '18 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.