To redirect specific requests to a specific address on the internal network, use dst-nat, follow the steps below:
- Once connected to the machine, select WebFig;
- Go to IP, Firewall section;
- Open the NAT tab;
- Create a new record by pressing Add New;
- A new window will open and fill in the following fields:
- Chain, choose dstnat because the IP address of the recipient will be changed;
- Select a protocol such as TCP;
- Dst. Port, specify the port that will be forwarded, for example port 80;
- In. In the Interface List, indicate the incoming interface to which the specific rule will apply, in this case it is WAN;
- Go to the bottom of the page, to the Action section;
- Action, select dst-nat;
- Enter the desired address to which you want to forward the data;
- Enter the required port.
This established rule can be translated as follows: When an incoming connection with the TCP protocol requests port 80, translate the recipient's address and redirect it to the local address 192.168.1.1 and port 80.