Search code examples
iisnetworkingrouteswindows-server-2003

Is it possible to forward all traffic to an IP Address?


we have a old and dying dedicated server. we want a new one at a new datacenter. we have a bunch of sites using the current server and don't have control of all their DNS. is there an easy way to redirect all the traffic from xx.xx.xx.xx to zz.zz.zz.zz without updating DNS records?

Thanks.


Solution

  • Judging from the IIS tag, I'm assuming you're replacing a web server. If that's the case, look into HTTP redirection. One example is here: http://www.somacon.com/p145.php

    This has the advantage of "telling" your clients that your page has moved permanently.

    If you're not using HTTP, Corey's iptables solution is appropriate. It can silently forward data:

    iptables -t nat -I PREROUTING -p tcp -d $OLD_DEST_IP --dport $DEST_PORT -j DNAT --to $NEW_IP
    

    Translation: in the nat (Network Address Translation) table, insert a rule in the PREROUTING chain that operates on TCP traffic to the old address:port and DNATs (changes the destination) to the same port at the new address.