Configure DHCP remote service with dnsmasq

Abiquo offers a DHCP remote service using dnsmasq, which overcomes some limitations of DHCP in a cloud environment. 

Requirements

The DHCP remote service that uses dnsmasq runs version 2.76.

  1. The remote service requires:
    1. A Tomcat server that is compatible with Abiquo Remote Services
      1. To configure this service independently of the other remote services, you can start a separate Tomcat using another port on a Remote Services Server or on a separate server
    2. A service network interface that VMs can reach to obtain their IPs
  2. DHCP with dnsmasq requires an IP address in each network. By default, this is the last address in the network range. The platform will exclude this IP from the valid address range to assign to VMs for the network

    1. To add existing networks in an existing datacenter, you will require an IP file as described in the procedure below

Install Dnsmasq remote service

  1. Download the current version of the Abiquo Dnsmasq package and install it.
    For example, to install a package with yum:

     yum install http://10.60.20.42/5.x/pkgs/el7/abiquo-dnsmasq-5.0.1-6018.el7.noarch.rpm
  2. The Dnsmasq remote service package will install Ruby and ruby-devel and gems as required. 

     Click here to expand...

    The package install process uses the following commands

    yum install ruby ruby-devel
    gem install json -v 1.7.7
    gem list
    *** LOCAL GEMS ***
     
    bigdecimal (1.2.0)
    io-console (0.4.2)
    json (1.7.7)
    psych (2.0.0)
    rdoc (4.0.0)


Configure Dnsmasq Remote Service in the datacenter

On the Remote Services server

  1. Edit the abiquo.properties file and set the service interface, and if required, set the base directory (for the leases and other configuration) and the path to the scripts

    abiquo.dnsmasq.serviceiface = eth1
    abiquo.dnsmasq.basedir = /opt/abiquo/dhcp
    abiquo.dnsmasq.startscript = /opt/abiquo/scripts/dnsmasq-vlan-start.rb
    abiquo.dnsmasq.stopscript = /opt/abiquo/scripts/dnsmasq-vlan-stop.rb
    abiquo.dnsmasq.reloadscript = /opt/abiquo/scripts/dnsmasq-vlan-reload.rb
  2. Restart the DHCP remote service that uses dnsmasq or the Tomcat server

  3. In Abiquo, add the DHCP remote service that uses the dnsmasq with its IP address and with the port 

    1. The default port is 8009

  4. When you create a new datacenter, select the new DHCP remote service. To use it with an existing datacenter, follow the instructions to configure Dnsmasq with existing datacenter networks.

Configure Dnsmasq with existing datacenter networks 

  1. If you have an existing datacenter with networks, use the restore scripts to register the IP addresses in dnsmasq and create leases for them at the datacenter or network level

    • To add the current network setup of the datacenter to dnsmasq

      1. Create an IP file to map the CIDRs to DHCP network addresses to input to the restore process. The following example of the file format shows default private networks, an external network, and a public network.

        192.168.0.0/24=192.168.0.254
        192.168.111.0/24=192.168.111.254
        30.30.30.0/24=30.30.30.254
      2. Obtain the API ID of your datacenter (e.g. 14) 

      3. Run the datacenter restore command using the IP address and credentials of your MySQL server and your Dnsmasq Remote Services server

        java -jar dnsmasq-restore-5.10.jar restore -db "jdbc:mysql://10.60.11.2/kinton?user=root&password=" -s "http://10.60.11.2:8009/dnsmasq" -dc 14 -ipfile myipfile
    • To add a given network to dnsmasq

      1. Obtain the API ID of your network (e.g. 10)
      2. Run the network restore command  using the IP address and credentials of your MySQL server and your Dnsmasq Remote Services server

        java -jar dnsmasq-restore-5.1.0.jar restore -db "jdbc:mysql://10.60.11.2/kinton?user=root&password=" -s "http://10.60.11.2:8009/dnsmasq" -ip "192.168.0.254" -vlan 10


Related links

Copyright © 2006-2022, Abiquo Holdings SL. All rights reserved