shameless self-promoting website
»Rejourn root
Posted Wednesday, 24 August 2011 by Miklos
Tags: en

This is going to be like my mysql password set post, I got tired of looking up the docs all the time, so here it is.

If you have a host running kvm instances and you want to forward the TCP port $hostport of the host machine $host to a port $guestport of the guest machine $guest, then you need:

iptables -t nat -A PREROUTING -p tcp -d $host --dport $hostport -j DNAT --to-destination $guest:$guestport