Discussion:
[libvirt-users] How libvirt interacts with dhcpd?
Daniel.
2018-06-15 22:49:56 UTC
Permalink
Hi everybody,

I'm using libvirt together with xCAT, on the same host, for testing
purposes. xCAT install and manages dhcpd. How libvirt interacts with
dhcpd? And if doens't how does the dhcp server of libvirt works, plus
where I can find information on how to troubleshot it?



Regards,
--
“If you're going to try, go all the way. Otherwise, don't even start. ..."
Charles Bukowski
Laine Stump
2018-06-18 03:55:12 UTC
Permalink
Post by Daniel.
Hi everybody,
I'm using libvirt together with xCAT, on the same host, for testing
purposes. xCAT install and manages dhcpd. How libvirt interacts with
dhcpd? And if doens't how does the dhcp server of libvirt works, plus
where I can find information on how to troubleshot it?
libvirt doesn't use dhcpd. It runs a separate instance of dnsmasq for
each virtual network that is defined within libvirt. Each instance
listens *only* on the bridge device that was created by libvirt for that
network. IIfi dhcpd has an option that tells it to listen on all
interfaces (or to automatically start listening on any new interface
that is created), you should disable that option so that it doesn't
attempt to listen for dhcp requests on the bridges created by libvirt.
Daniel.
2018-06-18 13:16:40 UTC
Permalink
Cool, thanks!! Does it have logs?


Cheers
Post by Daniel.
Hi everybody,
I'm using libvirt together with xCAT, on the same host, for testing
purposes. xCAT install and manages dhcpd. How libvirt interacts with
dhcpd? And if doens't how does the dhcp server of libvirt works, plus
where I can find information on how to troubleshot it?
libvirt doesn't use dhcpd. It runs a separate instance of dnsmasq for
each virtual network that is defined within libvirt. Each instance
listens *only* on the bridge device that was created by libvirt for that
network. IIfi dhcpd has an option that tells it to listen on all
interfaces (or to automatically start listening on any new interface
that is created), you should disable that option so that it doesn't
attempt to listen for dhcp requests on the bridges created by libvirt.
Laine Stump
2018-06-18 14:39:14 UTC
Permalink
Post by Daniel.
Cool, thanks!! Does it have logs?
Whatever dnsmasq chooses to log, and wherever it chooses to log it. (I
actually looked once to see if there was a way of reducing the amount of
logging, and didn't find much of anything useful.)

If you were planning to learn the current IP address of a particular
guest's interface by looking at the logs, you can instead use the virsh
domifaddr to to that.
Post by Daniel.
Cheers
Post by Daniel.
Hi everybody,
I'm using libvirt together with xCAT, on the same host, for testing
purposes. xCAT install and manages dhcpd. How libvirt interacts with
dhcpd? And if doens't how does the dhcp server of libvirt works, plus
where I can find information on how to troubleshot it?
libvirt doesn't use dhcpd. It runs a separate instance of dnsmasq for
each virtual network that is defined within libvirt. Each instance
listens *only* on the bridge device that was created by libvirt for that
network. IIfi dhcpd has an option that tells it to listen on all
interfaces (or to automatically start listening on any new interface
that is created), you should disable that option so that it doesn't
attempt to listen for dhcp requests on the bridges created by libvirt.
Daniel.
2018-06-18 17:00:34 UTC
Permalink
Thanks for the reply Laine. My problem is that dnsmasq is masking
dhcpd, xCAT uses dhcpd for PXE stuff. If dnsmasq answer DHCP requests
the PXE boot won' t work. I want to see the logs for ensuring the
dnsmasq is not masking dhcpd.

Regards,
Post by Laine Stump
Post by Daniel.
Cool, thanks!! Does it have logs?
Whatever dnsmasq chooses to log, and wherever it chooses to log it. (I
actually looked once to see if there was a way of reducing the amount of
logging, and didn't find much of anything useful.)
If you were planning to learn the current IP address of a particular
guest's interface by looking at the logs, you can instead use the virsh
domifaddr to to that.
Post by Daniel.
Cheers
Post by Daniel.
Hi everybody,
I'm using libvirt together with xCAT, on the same host, for testing
purposes. xCAT install and manages dhcpd. How libvirt interacts with
dhcpd? And if doens't how does the dhcp server of libvirt works, plus
where I can find information on how to troubleshot it?
libvirt doesn't use dhcpd. It runs a separate instance of dnsmasq for
each virtual network that is defined within libvirt. Each instance
listens *only* on the bridge device that was created by libvirt for that
network. IIfi dhcpd has an option that tells it to listen on all
interfaces (or to automatically start listening on any new interface
that is created), you should disable that option so that it doesn't
attempt to listen for dhcp requests on the bridges created by libvirt.
--
“If you're going to try, go all the way. Otherwise, don't even start. ..."
Charles Bukowski
Laine Stump
2018-06-20 13:59:42 UTC
Permalink
Post by Daniel.
Thanks for the reply Laine. My problem is that dnsmasq is masking
dhcpd, xCAT uses dhcpd for PXE stuff. If dnsmasq answer DHCP requests
the PXE boot won' t work. I want to see the logs for ensuring the
dnsmasq is not masking dhcpd.
The dnsmasq run by libvirtd only listens on bridges that libvirt itself
creates for libvirt virtual networks. If the PXE boot you're talking
about is happening on a different interface, then libvirt's dnsmasq will
not be messing with it.

If, on the other hand, you want to do PXE boot on the virtual networks
created by libvirt, then you can either 1) disable libvirt's dhcp on
that network by removing the <dhcp> section from the network definition
and restarting it, or 2) read in the libvirt virtual network
documentation on how to set it up to support PXE boot via dnsmasq (and
don't configure your dhcpd to listen on that interface).
Post by Daniel.
Regards,
Post by Laine Stump
Post by Daniel.
Cool, thanks!! Does it have logs?
Whatever dnsmasq chooses to log, and wherever it chooses to log it. (I
actually looked once to see if there was a way of reducing the amount of
logging, and didn't find much of anything useful.)
If you were planning to learn the current IP address of a particular
guest's interface by looking at the logs, you can instead use the virsh
domifaddr to to that.
Post by Daniel.
Cheers
Post by Daniel.
Hi everybody,
I'm using libvirt together with xCAT, on the same host, for testing
purposes. xCAT install and manages dhcpd. How libvirt interacts with
dhcpd? And if doens't how does the dhcp server of libvirt works, plus
where I can find information on how to troubleshot it?
libvirt doesn't use dhcpd. It runs a separate instance of dnsmasq for
each virtual network that is defined within libvirt. Each instance
listens *only* on the bridge device that was created by libvirt for that
network. IIfi dhcpd has an option that tells it to listen on all
interfaces (or to automatically start listening on any new interface
that is created), you should disable that option so that it doesn't
attempt to listen for dhcp requests on the bridges created by libvirt.
Daniel.
2018-06-20 15:59:18 UTC
Permalink
Thanks for your help Laine
In my case disabling dhcpd is not an option so I took the path of disabling
dhcp on virbr0. Pxe is handled by xcat which uses dhcpd for this. It seems
to be working fine :)

Regards
Post by Laine Stump
Post by Daniel.
Thanks for the reply Laine. My problem is that dnsmasq is masking
dhcpd, xCAT uses dhcpd for PXE stuff. If dnsmasq answer DHCP requests
the PXE boot won' t work. I want to see the logs for ensuring the
dnsmasq is not masking dhcpd.
The dnsmasq run by libvirtd only listens on bridges that libvirt itself
creates for libvirt virtual networks. If the PXE boot you're talking
about is happening on a different interface, then libvirt's dnsmasq will
not be messing with it.
If, on the other hand, you want to do PXE boot on the virtual networks
created by libvirt, then you can either 1) disable libvirt's dhcp on
that network by removing the <dhcp> section from the network definition
and restarting it, or 2) read in the libvirt virtual network
documentation on how to set it up to support PXE boot via dnsmasq (and
don't configure your dhcpd to listen on that interface).
Post by Daniel.
Regards,
Post by Laine Stump
Post by Daniel.
Cool, thanks!! Does it have logs?
Whatever dnsmasq chooses to log, and wherever it chooses to log it. (I
actually looked once to see if there was a way of reducing the amount of
logging, and didn't find much of anything useful.)
If you were planning to learn the current IP address of a particular
guest's interface by looking at the logs, you can instead use the virsh
domifaddr to to that.
Post by Daniel.
Cheers
Post by Daniel.
Hi everybody,
I'm using libvirt together with xCAT, on the same host, for
testing
Post by Daniel.
Post by Laine Stump
Post by Daniel.
Post by Daniel.
purposes. xCAT install and manages dhcpd. How libvirt interacts
with
Post by Daniel.
Post by Laine Stump
Post by Daniel.
Post by Daniel.
dhcpd? And if doens't how does the dhcp server of libvirt works,
plus
Post by Daniel.
Post by Laine Stump
Post by Daniel.
Post by Daniel.
where I can find information on how to troubleshot it?
libvirt doesn't use dhcpd. It runs a separate instance of dnsmasq
for
Post by Daniel.
Post by Laine Stump
Post by Daniel.
each virtual network that is defined within libvirt. Each instance
listens *only* on the bridge device that was created by libvirt
for that
Post by Daniel.
Post by Laine Stump
Post by Daniel.
network. IIfi dhcpd has an option that tells it to listen on all
interfaces (or to automatically start listening on any new
interface
Post by Daniel.
Post by Laine Stump
Post by Daniel.
that is created), you should disable that option so that it doesn't
attempt to listen for dhcp requests on the bridges created by
libvirt.
Loading...