Deploy Proxmox with KVM on a Hetzner server

Proxmox Logo

This guide will show you how to deploy Proxmox VE 5 with KVM Routing and NAT on a Hetzner server with focus on networking and DHCP/DHCPv6.

Assumptions

  • The connected interface is enp4s0
  • 192.0.2.62/27 is the public IP assigned by Hetzner
  • 192.0.2.33 is the default gateway for the network
  • 10.1.1.0/24 is the private block used on the VMs
  • 2001:db8:1111:2222::/64 is the IPv6 block assigned to the host
  • 2001:db8:1111:2222:81::/80 is the IPv6 block delegated to the VMs
  • The domain name used in the VMs is my.cloud
  • The host name of the hypervisor is hyper.my.cloud
  • All the commands are run as root

Deployment and Installation of Proxmox

Boot into rescue mode and run installimage. These are the settings for Custom image:

After rebooting the system, follow the installation instructions from the Proxmox Wiki to install Proxomx on your new Debian Stretch.

Additional tasks before you continue

  • Generate your SSL certificates: Proxmox Wiki. You will probably need to run apt-get install git first.
  • Create a user and give the permissions: Proxmox Wiki.
Warning!

The installation will be very slow until the RAID is initialized. You can check the status by running:

The output (while initializing), looks like this:

Network

Create /etc/network/interfaces

Make sure that the interfaces are configured correctly:

Create /etc/sysctl.d/local.conf:

Now you can reboot and continue below.

dnsmasq

In order to get out-of-the-box DHCP and DHCPv6 running, I’m using dnsmasq:

After installing it, you will need to create the folder for the leases and the TFTP boot:

Create /etc/dnsmasq.d/dnsmasq.conf

Reverse DNS in the VM network:

Create /usr/local/bin/show_ips.py:

Create /var/lib/dnsmasq/hosts.LAN

This snippet creates a list of 4096 hosts with random name using the python script above:

Restart dnsmasq