Setting up Auto IP for KVM (Updated 19th Apr 2017: OVH support)

***NEW Method***: with the new Auto Scripts Template feature you can now perform Linux/unix KVM Template Auto IP without the need of DHCP, for sample scripts check forum topic:

 Auto IP for KVM is managed through installing Third Party DHCP software on Proxmox Nodes. DHCP is configured to Listen on the Bridge Interface that KVM will belong to, and in WHMCS configure IP Pool inside that subnet and specify the pool and related bridge inside the KVM Templates under Auto provisioning area.

Proxmox Module will auto add the new KVMs to this bridge and auto add static MAC to IP mapping inside the DHCP server.

Proxmox Node Setup:

  • Install DHCP server package on Proxmox Node : apt-get install isc-dhcp-server
  • Create the Bridge Type interface that you plan to use for KVM in Proxmox GUI, let's assume vmbr0 and make sure to give it an IP from the subnet netmask that will be used.
  • Also depend on your setup you might need to add routes, whether globally or let interface manage it: vi /etc/network/interfaces
auto vmbr0
iface vmbr0 inet static
bridge_ports none
bridge_stp off
bridge_fd 0
up ip route add dev eth0
down ip route del dev vmbr0
  • Configure DHCP server to listen on this interface in file vi /etc/default/isc-dhcp-server  example:
    #Defaults for dhcp initscript
    #sourced by /etc/init.d/dhcp
    #installed at /etc/default/isc-dhcp-server by the maintainer scripts
    #This is a POSIX shell fragment
    #On what interfaces should the DHCP server (dhcpd) serve DHCP requests"
    #Separate multiple interfaces with spaces, e.g. “eth0 eth1".
  • Now configure your IP subnet, no need to specify ranges, this will be managed by module, just use to accomodate all subnets on same bridge and assuming below my gateway is, in  vi /etc/dhcp/dhcpd.conf  example:

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
option rfc3442-classless-static-routes code 121 = array of integer 8;
option ms-classless-static-routes code 249 = array of integer 8;

subnet netmask {
default-lease-time 21600000;
max-lease-time 432000000;
option routers;
option domain-name-servers,;
option rfc3442-classless-static-routes 32, 192, 168, 0, 5, 0, 0, 0, 0, 0, 192, 168, 0, 5;
option ms-classless-static-routes 32, 192, 168, 0, 5, 0, 0, 0, 0, 0, 192, 168, 0, 5;
  • note in my example above "#vmbr0ip4" this is very important, as Module use this note to know where to insert the Static MAC to IP Mapping, if IPv6 is used, then the note under the subnet6 will be "#vmbr0ipv6", the note contains the bridge name and ip4 or 6, must be inserted before closing the subnet braces "}"
  • More info about configuring DHCP server can be found here :
  • By default ip4 is supported, to support ipv6, more steps is needed in DHCP server, refer to
  • once confg is done, restart the DHCP service :  service isc-dhcp-server restart
  • you might need to enable proxy_arp 
echo 1 > /proc/sys/net/ipv4/conf/vmbr0/proxy_arp

If Using OVH based nodes

  • First thing in OVH manager generate Virtual MAC on all IPs
  • Copy those MAC and put them in the list of MAC=IP and Head to IP Pools and Add/Edit IP Pool of type IP list and in the IP list add.
  • your gateway will be your proxmox node ip but instead of last octet will be .254 so if my proxmox node ip is then gateway will be, set in IP pool the gateway and subnet:
  • That's it. Now module auto give MAC to new VMs and dhcp will assign IP to it and the default route/gateway and OVH mac to IP bind will allow it internet.



  • Module use SSH to alter the DHCP configurations on Service Activation and Termination.
  • Proxmox Nodes need to be configured in WHMCS using root pam user login, you can alter this for current configured nodes in WHMCS > Setup > Products & Services > Servers, edit the present nodes and modify username/password/accesshash to root/<password>/pam
  • Starting Module version, this step is optional, if on older version then You need to have PHP-ssh2 installed and activated inside of PHP on the WHMCS server, check for Steps on how to configure/install PHP-ssh2 on different platforms

Proxmox KVM Template:

  • if using kvm template then before converting your vm to be a templae, make sure interfaces has no network id, mac or ip specified, for linux should like this:

  • you might better create ifcfg-eth1 as well eith same config above but device=eth1
  • once done shutdown VM and convert it to template
  • Head to the new template in proxmox gui and delete the network interface, you do not need proxmox to have same interface for every single clone, Module will be adding new interfaces automatically with unique mac and ip 

WHMCS Proxmox Module Config:

  1. Nodes need to be added using user Root on PAM, to be sure head to WHMS > AdminArea > Setup > Products & Services > Servers, edit the proxmox nodes and make sure the username/password is for root and Accesshash is pam.
  2. Create the IP ranges/blocks in WHMCS > AdminArea > Addons > Proxmox Manager > IP Pools, you can create both IP list or IP Range type of IP Pools.
  3. Head to Auto Provisioning and Add/Edit KVM Templates, in Network Tab, click "Add new Network" and check the Bridge Check box.
  4. Choose the Bridge interface we created on Proxmox node, in our example vmbr1, and choose the IP pool we just configure.
  5. Save...That's it give it some test to check if KVMs are getting the assigned IPs in WHMCS and also trace connectivity on VPS to check if any more routes need to be added or all is set.
  • 3 Users Found This Useful
Was this answer helpful?

Related Articles

Getting error Could not poll for Version while configuring

Symptoms:Error: Could not poll for Version while configuringProblem:To be able to solve this...

Proxmox Backup Notifications Failing

Problem:   After Enabling Mailto feature for backup notificatins, no backup completion...

KVM arbitrary arqument usage

writing in progress

Installing PHP-SSH2 for KVM Auto IP

**Only Required FOR MODULE VERSION 1.3.1 or LOWER, STARTING this is optionaal as WE USE...

OpenVZ Console not Progressing

Symptoms:Error: unable to write `random state`Error: ,Error: nothing showing on new Console, only...

Powered by WHMCompleteSolution