Redirect all traffic to IP nn to internal IP xx
Lets say I have 24 external IP addresses of 120.120.120.1-120.120.120.24 on one server, and on that server I have an internal IP of 192.168.1.10 (VMware "host only" network or internal NAT).
I want all traffic directed at 120.120.120.20 to go to the internal IP 192.168.0.10, and I want all traffic coming out of that IP come out as from 120.120.120.20.
So basically, guess this would be a simple NAT.
How would I do this in iptables, what are the commands?
I'd also like to fine tune it where I block most traffic and only allow a few ports.
I also want to be able to block IPs, that part I know how.
Could someone point me in the right direction for writing a rule like this?
Thanks.
|