Score:0

Port forwarding is one way or two way? Requests made on external port are forwarded to internal port; understood. How about route of responses?

ru flag

Port forwarding is one way or two way? Requests made on external port are forwarded to internal port; understood. How about responses? Do Responses pass by same portforwarding again, or responses are from the device on local network to router than to the client (that made the request) directly (without passing by same port forwarding again) ??

Does the below image make sense; to explain portforwarding?

enter image description here

Score:0
st flag

It's somehow two ways, and somehow one way. Based on your question and image, I'm considering you're using NAT.

Let's suppose a user with source IP 111.111.111.111 and requests outgoing from port 7777

Your public IP is 49.207.10.38 and your edge router or proxy is listening on port 80

Your internal router's private IP 192.168.1.254

Your internal server's IP is 192.168.1.100

  1. User reaches your router or proxy: 111.111.111.111:7777 -> 49.207.10.38:80
  2. NAT translates public IP to internal private IP: instead of sending internal packages from 49.207.10.38, it sends as 192.168.1.254 in way internal nodes can answer back to the router.
  3. Your router redirects packets to the internal server: 192.168.1.254.7777 -> 192.168.1.100:80
  4. The internal server process the request and answers page's content to the source server (which is now the internal router): 192.168.1.100:80 -> 192.168.1.254:7777
  5. Router applies NAT translation in order to send it back to the original requester, but now, NAT also translates its internal IP to the public IP in order to public user can reach it from the public internet (it will source the package as 49.207.10.38 instead of 192.168.1.254): 49.207.10.38:80 -> 111.111.111.111:7777

That being said, bear in mind that:

  • if the request comes from port 7777 to port 80, the answer will be sent from port 80 to port 7777

  • if you're placing your server in a private network, you need to use NAT in order to masquerade private IPs to public router IP

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.