problem of gateway: SNAT, DNAT and netfilter
I would like to create a gateway in order to do a special kind of NAT.
I need to do SNAT and DNAT in this way :
@src A.X.Y.Z -> A+1.X.Y.Z
@src 192.168.0.1 -> 22.214.171.124
@src 191.23.33 -> 192.23.33
@dst A.X.Y.Z -> A+1.X.Y.Z
@dst 126.96.36.199 -> 188.8.131.52
@dst 184.108.40.206> 220.127.116.11
I know how to do it with "static list" of @IP with iptables :
iptables -t nat -A PREROUTING -d 192.168.0.1 -j DNAT --to-destination 18.104.22.168
iptables -t nat -A POSTOUTING -s 22.214.171.124 -j DNAT --to-destination 126.96.36.199
But, as I have a large number of @IP, how can I do it for ALL ip addresses ?
Thank you for giving few secondes to explain me how to do it if you have an answer.
Thank you !