Troubleshooting DHCP with dnsmasq



Check the log files

The log file for the Dnsmasq remote service is found at /opt/abiquo/tomcat/logs/dnsmasq-servlet.log.

The virtualfactory.log and catalina.out files may also contain information about the Dnsmasq remote service.

Check lease files for a VLAN tag

To check the DHCP configuration created by the restore, display the files /opt/abiquo/dhcp/\{vlanTag} in the hosts and addn_hosts folder.

 Click here to expand...
root@dnsmasqserver admin]# cat /opt/abiquo/dhcp/2/addn_hosts/00_50_56_*
192.168.0.1 host-192-168-0-1.default_private_network.local host-192-168-0-1
192.168.0.4 host-192-168-0-4.default_private_network.local host-192-168-0-4
192.168.0.2 host-192-168-0-2.default_private_network.local host-192-168-0-2
192.168.0.3 host-192-168-0-3.default_private_network.local host-192-168-0-3

[root@dnsmasqserver admin]# cat /opt/abiquo/dhcp/2/host/00_50_56_*
00:50:56:14:ac:f7,host-192-168-0-1.default_private_network.local,192.168.0.1
00:50:56:17:12:8e,host-192-168-0-4.default_private_network.local,192.168.0.4
00:50:56:29:6d:87,host-192-168-0-2.default_private_network.local,192.168.0.2
00:50:56:34:5d:0c,host-192-168-0-3.default_private_network.local,192.168.0.3


Check lease files with dnsmasq-cli

To use the dnsmasq CLI script to list the configuration for a VLAN tag (e.g. 5), use the dnsmasq-cli command with the IP address of the Dnsmasq remote service. For example, for version 5.1.0

java -jar dnsmasq-cli-5.1.0.jar -s "http://10.60.11.2:8009/dnsmasq"  -t 5 list


Check that dnsmasq is running

The Dnsmasq remote service should run an instance of dnsmasq for each VLAN. To check for the instances of dnsmasq running on the server use the following command.

ps aux | grep -i dnsmasq
 Click here to expand...

Example of results

nobody    4695  0.0  0.0  53900   932 ?        S    jul06   0:00 dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces --interface=abi_netns_5 --except-interface=lo --pid-file=/opt/abiquo/dhcp/5/pid --dhcp-hostsdir=/opt/abiquo/dhcp/5/host --addn-hosts=/opt/abiquo/dhcp/5/addn_hosts --dhcp-optsfile=/opt/abiquo/dhcp/5/opts --leasefile-ro --dhcp-range=tag0,192.168.0.254,static,86400s --dhcp-lease-max=256 --conf-file= --domain=abiquo.local
nobody    4710  0.0  0.0  53900   928 ?        S    jul06   0:00 dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces --interface=abi_netns_6 --except-interface=lo --pid-file=/opt/abiquo/dhcp/6/pid --dhcp-hostsdir=/opt/abiquo/dhcp/6/host --addn-hosts=/opt/abiquo/dhcp/6/addn_hosts --dhcp-optsfile=/opt/abiquo/dhcp/6/opts --leasefile-ro --dhcp-range=tag0,192.168.0.254,static,86400s --dhcp-lease-max=256 --conf-file= --domain=abiquo.local

No hypervisors found error

When you run the dnsmasq-restore tool, an error may appear that begins with "No hypervisors found" and ends with "Cannot create vlan default_private_network with tag X".

This error appears when there is already an instance of dnsmasq running for this VLAN.

 Click here to expand...

dnsmasq-restore tool command and error

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

Vlan default_private_network tag 2 will use 192.168.0.254

com.abiquo.commons.plugin.exception.HypervisorPluginException: No Hypervisors found at the given IP.
	at com.abiquo.dnsmasq.plugin.DnsmasqClient.createNewHostRule(DnsmasqClient.java:83)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at dnsmasqshaded.retrofit2.Platform$Java8.invokeDefaultMethod(Platform.java:86)
	at dnsmasqshaded.retrofit2.Retrofit$1.invoke(Retrofit.java:144)
	at com.sun.proxy.$Proxy5.createNewHostRule(Unknown Source)
	at com.abiquo.dnsmasq.DnsmasqRestore.restore(DnsmasqRestore.java:213)
	at com.abiquo.dnsmasq.DnsmasqRestore$Restore.run(DnsmasqRestore.java:194)
	at com.abiquo.dnsmasq.DnsmasqRestore.main(DnsmasqRestore.java:52)
Caused by: java.io.IOException: java.io.IOException
	at dnsmasqshaded.com.linecorp.armeria.client.retrofit2.ArmeriaCallFactory$ArmeriaCall.execute(ArmeriaCallFactory.java:193)
	at dnsmasqshaded.retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
	at com.abiquo.dnsmasq.plugin.DnsmasqClient.createNewHostRule(DnsmasqClient.java:79)
	... 7 more
Caused by: java.io.IOException
	at dnsmasqshaded.com.linecorp.armeria.client.retrofit2.ArmeriaCallSubscriber.onError(ArmeriaCallSubscriber.java:101)
	at dnsmasqshaded.com.linecorp.armeria.common.stream.DefaultStreamMessage$CloseEvent.notifySubscriber(DefaultStreamMessage.java:638)
	at dnsmasqshaded.com.linecorp.armeria.common.stream.DefaultStreamMessage.notifySubscriberWithCloseEvent(DefaultStreamMessage.java:403)
	at dnsmasqshaded.com.linecorp.armeria.common.stream.DefaultStreamMessage.notifySubscriber(DefaultStreamMessage.java:317)
	at dnsmasqshaded.com.linecorp.armeria.common.stream.DefaultStreamMessage.lambda$notifySubscriber$2(DefaultStreamMessage.java:298)
	at dnsmasqshaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at dnsmasqshaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
	at dnsmasqshaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:309)
	at dnsmasqshaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
	at dnsmasqshaded.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
	at java.lang.Thread.run(Thread.java:748)
Caused by: dnsmasqshaded.com.linecorp.armeria.client.ResponseTimeoutException

Cannot create vlan default_private_network with tag 2


To resolve this error:

  1. Check there is no dnsmasq instance using the same tag (check it with "ps aux | grep -i dnsmasq" and kill the related process )
  2. Use the dnsmasq-restore tool again




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