Forward webtrafic during server migration

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
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
iptables -t nat -A PREROUTING -p tcp –dport 443 -j DNAT –to-destination

iptables -t nat -A POSTROUTING -j MASQUERADE

Dette indlæg blev udgivet i Knowledge Base, Linux, Old Base. Bogmærk permalinket.

Skriv et svar