

The support for base-port based 1:1 port mapping in DNAT was added in 2018. In the above case, the DNAT mapping will round itself like this: 30000 -> 10.1.1.1:40000 Now, let's say the incoming range and outgoing range are not equal: iptables -t nat -I PREROUTING -p tcp -dport 30000:30199 -j DNAT -to 10.1.1.1:40000-40099/30000 Using NETMAP in POSTROUTING chain will act as SNAT for whole mapping network. I created a Virtual IP address of 192.168.254.253 on the WAN address of the OpnSense router, and am trying to cause all traffic intended for 192.168.254.253 to forward transparently to 192.168.1.2, kind of like what is referred to as a DMZ on other routers. Here, 32770 is the base-port, and the mapping will start from there, for example: 32770 -> 172.17.0.36:1000 There is no way to change destination ip in POSTROUTING table. Dst-nat only operates on a single host, but has the advantage of also being able to change the destination port. Create one or more IP interfaces and assign them IP addresses.

It's main purpose is to manipulate a whole block of addresses with one command, but only change the address (not port). This guide describes the firewall and NAT features on the Allied Telesis UTM Firewalls.

Here is an example output for comparison. You should see in the output entries for 80, 443, 8080, and 8443. Use the following command to list the current iptables configuration: iptables -L -n. I've struggled a lot to find this and finally found a solution that absolutely works, the command in your case would be: iptables -t nat -A DOCKER ! -i docker0 -p tcp -m tcp -dport 32770:32771 -j DNAT -to-destination 172.17.0.36:1000-1002/32770 Netmap let's you do 1:1 nat from one rage of IP's to another. In order to forward traffic from 80/443 to 8080/8443, first you must ensure that iptables has allowed traffic on all 4 of these ports.
