0

Well both reverse proxy and port forwarding looks for any incoming packets destined to a particular machine which is present in local network. How both of them are different ?

2
  • 1
    Port forwarding is really just a manual entry in in one of the NAPT tables, but proxy is an (off-topic) application-layer function/feature.
    – Ron Maupin
    Oct 16 '20 at 15:20
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Dec 17 '20 at 22:36
4

Port forwarding describes a layer-4 mechanism, operating on TCP connections or UDP packets without necessarily understanding the application data.

Reverse proxy suggests a higher-layer (this is where the OSI model doesn't map directly to TCP/IP) application-aware proxy. In the old days, a proxy server was most commonly used between users and the Internet; so reverse indicates the other way around, used to proxy traffic from the Internet to server(s).

2
  • 2
    You should also mention that port forwarding is a NAT concept - destination NAT enables access from public to private address space.
    – Zac67
    Oct 16 '20 at 14:45
  • Port forwarding can be done without NAT. I've had userland programs to do this longer than NAT has been a concept. (It's a demo of the UNIX socket API. In the 80's this was also possible with a string of telnet's -- inetd service that runs telnet...)
    – Ricky
    Oct 16 '20 at 22:11
3

Reverse proxy

Reverse proxy help the client traffic from outside networks towards servers deployed in internal networks to distribute load equally on backend servers . Basically reverse proxy is inducted behind firewall and more than one back end servers are connected to reverse proxy .

Portforwarding

Portforwarding is a technical term used in networking . When the client wants to access server deployed behind firewall on specific service ports . As server is behind firewall client can't reach server beacuse of restriction in firewall . To allow this connection port opening is required from client IP address to server IP address on specific ports this policy Configure in firewall is referred as port forwarding.

2

While both methods might look similar, they are entirely different technically.

A proxy accepts a socket connection and fulfills the client request in some way or other. Usually, it creates its own request to the indicated server.

The by far most common example is an HTTP proxy that accepts HTTP requests from clients, uses its own HTTP request to retrieve the page/object, and then forwards the data to the client. Proxies can even translate application layer protocols (e.g. FTP over HTTP proxy) but they are always application-specific which makes them application-aware as well. Proxies were widely used for private-to-public Internet access before NAT become common. They can also be used for caching or deeper insight into the application protocol (application-layer gateway, malware scan, content filtering, ...).

A reverse proxy is used the other way around: public access for servers within private LANs. Since a proxy understands the application protocol, it can be used as a single entry point for multiple exposed servers, especially with HTTP. A reverse proxy can have multiple functions, including

  • caching
  • load balance across a number of backing servers
  • port sharing (multiple web servers are accessed using the same public IP address and transport-layer port number, distinguished by host header)
  • offloading SSL to the proxy
  • application-layer gateway/filtering

Port forwarding is another term for destination NAT aka reverse NAT, sometimes also virtual IP: a router translates a packet's public destination address to the actual private address to enable access from the Internet to privately addressed servers. In contrast to a proxy, a NAT router is not aware of the application protocol that's currently used. It only translates IP addresses and possibly transport-layer (L4) port numbers.

That way, it isn't possible to enable public access to multiple private servers using a single public IP address and L4 port - you need to either have multiple public addresses or use multiple ports.

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.