title: Can I port forward from one interface port to another interface port?
body: <p>I am "programming TCP sockets" and have some fundamental questions.</p>
  
  <p>When I specify an IP address and port for a TCP client, I know that the IP address belongs to a network interface and not the actual computer as a whole, and that the computer has multiple network interfaces, including the inward facing local host loop back interface.</p>
  
  <p>Does the port specified to the TCP client belong to the specified interface? Like for example, can there be two ports of the same number but on two different interfaces? Like port 5000 of interface A and port 5000 of interface loop back?</p>
  
  <p>I ask this, because I am trying to create a TCP client which will connect via socket to a TCP server running on an Android Virtual Device. The TCP client runs on machine A and the android emulator runs on machine B.</p>
  
  <p>I have looked up port forwarding for Android Emulators, and have learned that the emulator runs behind a virtual router, and that I must configure port forwarding such that TCP socket connections can be routed from one port to another, but these documents only have instructions on how on how to port forward from the loop back interface (the so called local host), so obviously, if I try to create a socket to an interface which is not the loop back interface, I don't get my TCP socket forwarded to the emulator, and my TCP connection fails.</p>
  
  <p>So I wonder if port 5000 on the loop back interface has cousin port 5000 on an outwards facing networking interface?</p>
  
  <p>And I wonder if at some low level I can port forward from the outward facing interface port 5000 to the loopback interface port 5000 which will then forward to port the emulator is situated on.</p>
  
  <p>Is this possible?</p>