I need to set up dnsmasq to offer DHCP (and optionally DNS) to VMs running on the localhost only, and not to any other systems doing a DHCP Discover that are external to the box running dnsmasq. Do I just set the options:
interface=lo0
bind-interfaces
Or is there other config that is needed?
Listening on the loopback interface will probably not work, because your virtual machines are not attached to the loopback interface (so
dnsmasq
will not see their DHCP requests).You will need
dnsmasq
to listen on the interface to which your virtual machines are attached. Typically, this will be a bridge interface. Without seeing how your system is configured it's difficult to offer a more detailed answer.If you are using
libvirt
, then by default (at least under RedHat-ish systems) you get adnsmasq
instance listening onvirbr0
that start up like this: