I am trying to make destination NAT from one range (192.168.2.0/24) to corresponding ip addresses in another range (192.168.1.0/24).
I have managed to do this ip by ip
iptables -t nat -A PREROUTING -i ppp0 -d 192.168.2.1 -p all -j DNAT --to-destination 192.168.1.1
iptables -t nat -A PREROUTING -i ppp0 -d 192.168.2.2 -p all -j DNAT --to-destination 192.168.1.2
iptables -t nat -A PREROUTING -i ppp0 -d 192.168.2.3 -p all -j DNAT --to-destination 192.168.1.3
etc..
Is any way that I can specify source & destination range in single line ?
Thanks!