We had to move some servers to another datacenter, and the customers dns provider was a bunch of n00bs so we had to respond on both ip’s for some time.
So we kept a virtualcenter in the old datacenter running this:
root@proxy:~# cat fw.sh
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
iptables -t nat -F PREROUTING
iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –to-destination 126.96.36.199:80
iptables -t nat -A PREROUTING -p tcp –dport 443 -j DNAT –to-destination 188.8.131.52:443
iptables -t nat -A POSTROUTING -j MASQUERADE