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 -> 184.108.40.206
@src 191.23.33 -> 192.23.33
@dst A.X.Y.Z -> A+1.X.Y.Z
@dst 220.127.116.11 -> 18.104.22.168
@dst 22.214.171.124> 126.96.36.199
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 188.8.131.52
iptables -t nat -A POSTOUTING -s 184.108.40.206 -j DNAT --to-destination 220.127.116.11
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 !