So currently I’m running libvirt on my debian box, and it’s DHCP server is listening on all interfaces, I would like to restrict that down to the bridge interface where the VMs would live. I can kill off the dhcp server temporarily to accomplish what I need but would like something more permanent.
I’m sure there is some option I can put in the dhcp server portion of the network config to make this happen.
<network>
<name>default</name>
<uuid>2fb34907-96bc-4af1-89a2-4f1f872a2600</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:c3:d2:ea'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
<host mac='52:54:00:21:df:dc' ip='192.168.122.2'/>
</dhcp>
</ip>
<route address='192.168.122.2' prefix='32' gateway='192.168.122.110'/>
</network>
root@calypso-deb:~# lsof -i -n | grep dnsmasq
dnsmasq 1656 nobody 3u IPv4 29150 0t0 UDP *:bootps
dnsmasq 1656 nobody 5u IPv4 29153 0t0 UDP 192.168.122.1:domain
dnsmasq 1656 nobody 6u IPv4 29154 0t0 TCP 192.168.122.1:domain (LISTEN)
root@calypso-deb:~#
2
Answers
It should already be listening on
virbr0
interface only, as the config shows that too.You can check that with
lsof -i -n | grep dnsmasq
or similar tools.Here’s a suggestion (which is meant to be a comment rather than an answer, but I cannot comment).
User Jonathon Reinhart posted an answer that describes how to pass options to dnsmasq (since libvirt v.5.6.0). See also “Network XML format” in the libvirt documentation. This got me wondering whether passing something like
--interface=virbr0 --bind-interfaces
would do what you need in this case.