Notes to Self

Proxmox 3.1 on hetzner.de, OpenVZ and VMs with internal IPs

Just in case you have been wondering how to run your own virtualized servers without knowing much about network setup: Get your root server at Hetzner.de, install the (unofficial and unsupported) Proxmox 3.1 server image, and start creating OpenVZ containers (NOT KVM machines) with internal IPs such as 192.168.0.1. Proxmox does all the hard work for you, using the super-simple “venet” network setup. The VMs already have access to the internet, all you have to do is to route incoming IP traffic from port to port:

iptables -t nat -A PREROUTING -p tcp -d host_ip_address --dport port_num \
  -i eth0 -j DNAT --to-destination ve_address:dst_port_num

After having read tutorial after tutorial containing very complicated bridged and routed network setups, I was surprised that it was so easy. Hope this helps.