iptables: How to combine DNAT and SNAT to use a secondary IP address?

view story

http://serverfault.com – There are lots of questions on here about iptables DNAT/SNAT setups but I haven't found one that solves my current problem. I have services bound to the IP address of eth0 (e.g. and I also have a IP address on eth0:0 ( which is shared with another server. Only one server is active, so this alias interface comes and goes depending on which server is active. In order to get traffic accepted by the service a DNAT rule is used to change the destiantion IP. iptables -t nat -A PREROUTING -d -p udp --dport 7100 -j DNAT --to-destination I also w (HowTos)