Redirect / Rewrite destination IP address using iptables

Just a quick one on how to alter the destination of an outbound connection IP using iptables. I imagine a few tweaks would allow this to work in the sense of redirecting through a proxy etc too.

iptables -t nat -I OUTPUT --dest -p tcp --dport 80 -j DNAT --to-dest

This one will specifically change which IP your machine actually uses for EdgeCast’s CDN, but you can easily change the original IP (–dest) and the new destination IP (–to-dest)

Fancy an email update instead of having to pop back here every time?

Heya! I’m Cohan and I make websites. I also administer Linux servers and do other nerdy good stuff like that.
My real love is writing though, this here’s my outlet for that.
A picture of me.