This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
forward-basic [2023/06/21 03:50] – -explain Protocol bullet text hogwild | forward-basic [2023/10/26 17:27] (current) – [Advanced Scenarios] -condense hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Port Forwarding - Basic ====== | ====== Port Forwarding - Basic ====== | ||
- | NAT (Network Address Translation) | + | When traffic |
- | Connections initiated on the Internet will not reach a LAN IP address, as the PAT table doesn' | + | \\ |
+ | |||
+ | ==== NAT ==== | ||
- | There are several types of NAT. The most common and relevant for FreshTomato is PAT (Port Address Translation). PAT is what FreshTomato performs by default. With PAT, translation happens not only between | + | NAT (Network |
- | NOTE: A legacy legacy setting exists | + | Connections initiated |
\\ | \\ | ||
- | [[https://wiki.freshtomato.org/lib/exe/detail.php? | + | ==== PAT ==== |
+ | |||
+ | There are several types of NAT. The most common and relevant for FreshTomato is PAT (Port Address Translation). By default, FreshTomato performs PAT translation. With PAT, translation happens not only between private and public IP addresses, but also between ports. For example, a request for an Internet connection from 192.168.0.100 to google.com will create a NAT mapping to allow the return packets to be sent to the correct LAN device on the correct port. However, in some cases, you may want to have one port on the WAN always mapped/ | ||
+ | |||
+ | NOTE: There is an obsolete setting in the Miscellaneous section of some older versions in of the //Advanced///[[advanced-routing|Routing]] menu that suggests FreshTomato can operate in Gateway mode or Router mode. Ignore this, and leave it set to " | ||
\\ | \\ | ||
- | When traffic is initiated from the Internet towards FreshTomato' | + | [[https://wiki.freshtomato.org/lib/ |
+ | |||
+ | \\ | ||
- | **On:** Checking this enables the settings in that row of the table. (Deafult: Off). | + | **On:** Checking this enables the settings in that row of the table. (Default: Off). |
**Protocol: | **Protocol: | ||
Line 24: | Line 32: | ||
* TCP - only TCP connections are forwarded | * TCP - only TCP connections are forwarded | ||
* Both - both UDP and TCP connections are forwarded | * Both - both UDP and TCP connections are forwarded | ||
+ | |||
+ | \\ | ||
+ | |||
+ | [[https:// | ||
\\ | \\ | ||
- | **Src Address**: (Optional). This will restrict the rule so it's applied only from specific source addresses. | + | **Src Address**: (Optional). This will restrict the rule so it's applied only from specific source addresses. DNS hostnames, FQDN names and IP addresses |
**Ext Port:** This defines a mapping to the (external) port the Internet connection expects to use. It can be a single port or a range, with syntax: " | **Ext Port:** This defines a mapping to the (external) port the Internet connection expects to use. It can be a single port or a range, with syntax: " | ||
- | **Int Port:** (Optional). Here, you can specify a different (internal) port to the target LAN IP address. Leaving this empty uses the same port as the Ext Port \\ (Default: empty). | + | **Int Port:** (Optional). Here, you can specify a different (internal) port for the target LAN IP address. Leaving this empty uses the same port as the Ext Port setting\\ (Default: empty). |
- | **Int Address:** This specifies the internal | + | **Int Address:** This specifies the internal |
**Description: | **Description: | ||
Line 39: | Line 51: | ||
\\ | \\ | ||
- | [[https://wiki.freshtomato.org/ | + | \\ |
+ | |||
+ | ==== Advanced Scenarios ==== | ||
+ | |||
+ | As we know, only one given socket (port/protocol combination) can be forwarded at any given time. For example, if port 80 is already redirected to 192.168.1.10, this port is now " | ||
+ | |||
+ | === Reverse Proxy === | ||
+ | |||
+ | In order to perform its job, a proxy must speak the protocol used by the application. For example, an HTTP proxy cannot serve SMTP. If you needed to redirect, say, HTTP to multiple internal hosts from the same external port, a reverse proxy is a good solution. According to HTTP v1.1, the target hostname must be included in the HTTP client request. This allows a proxy to fetch such information, | ||
+ | |||
+ | === Source Bound Redirection === | ||
+ | |||
+ | If the source IP and/or FQDN is well-known, you can create multiple port mapping references on the same port:protocol combination as long as the source is defined differently. The following settings would work fine: | ||
\\ | \\ | ||
+ | |||
+ | | ||
+ | |||
+ | \\ | ||
+ | |||
+ | The settings above would cause traffic from the IP address(es) of " | ||
\\ | \\ | ||