09-26-2014 10:48 PM - edited 03-04-2019 11:51 PM
Hi peeps,
Can anyone tell me the exact usage of port forwarding (when, why, where & how)?
Thanks.
Solved! Go to Solution.
09-26-2014 11:08 PM
Hi,
Port forwarding is just PAT ( port address translation), a form of NAT. Suppose you have a web server sitting behind a firewall or router, the web server has IP 1.1.1.1/24 and listens on port 8080. Your routers outside interface is 2.2.2.2/24.
Assume no NAT is being performed, users on the internet can access 1.1.1.1 directly. User fires up a browser and browses to 1.1.1.1-- it whats to talk to your web server on port 80. But your server is listening on port 8080. Your router needs to forward request for 1.1.1.1:80 to 1.1.1.1:8080. That is port forwarding. Generically its a form of PAT ( port address translation).
Another example is where you have webserver1 and webserver2. Both are listening on port 80 but are addressed with private IPs. Assume you use static NAT to translate the two webserver private IPs to a single public IP. How does the router know which server to send the traffic to if a request comes in for port 80? The answer is port forwarding. In this case, you could forward port 8081 to webserver1 and port 8082 to webserver2. Now when a user fires up a browser they can type http:1.1.1.1:8081 to hit webserver1. Likewise, they type http://1.1.1.1:8082 to hit webserver2.
HTH
Joe
Rate if helpful
09-26-2014 11:08 PM
Hi,
Port forwarding is just PAT ( port address translation), a form of NAT. Suppose you have a web server sitting behind a firewall or router, the web server has IP 1.1.1.1/24 and listens on port 8080. Your routers outside interface is 2.2.2.2/24.
Assume no NAT is being performed, users on the internet can access 1.1.1.1 directly. User fires up a browser and browses to 1.1.1.1-- it whats to talk to your web server on port 80. But your server is listening on port 8080. Your router needs to forward request for 1.1.1.1:80 to 1.1.1.1:8080. That is port forwarding. Generically its a form of PAT ( port address translation).
Another example is where you have webserver1 and webserver2. Both are listening on port 80 but are addressed with private IPs. Assume you use static NAT to translate the two webserver private IPs to a single public IP. How does the router know which server to send the traffic to if a request comes in for port 80? The answer is port forwarding. In this case, you could forward port 8081 to webserver1 and port 8082 to webserver2. Now when a user fires up a browser they can type http:1.1.1.1:8081 to hit webserver1. Likewise, they type http://1.1.1.1:8082 to hit webserver2.
HTH
Joe
Rate if helpful
09-28-2014 12:20 AM
thank you very much...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide