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