[Dnsmasq-discuss] DHCP simultaneous with static addresses and autoconf

Laine Stump laine at laine.org
Fri Mar 27 19:51:55 GMT 2015


(the following is on RHEL, Fedora, and CentOS clients; I'm not sure what
behavior is on other platforms.)

First, a question about client behavior (i.e. not specific to dnsmasq):

I noticed a long time ago that IPv4 clients configured for both static
IP addresses and dhcp would discard the static IP addresses in favor of
the one from dhcp. Likewise, I found the same behavior for IPv6 when
checking it for this bug report:

  https://bugzilla.redhat.com/show_bug.cgi?id=1113983

This is different from IPv6 autoconf behavior - you can configure a
static IP and set autoconf, and you will end up with both IP addresses.

I don't see any reason why a client shouldn't behave the same with dhcp
- just keep the static address and add the address from dhcp, and am
thinking this is just a deficiency in the dhcp client implementation (in
this case ISC dhclient). Is there anything in the DHCP standard that I'm
overlooking that would preclude static + dhcp ( + autoconf) on the same
interface from working?

And now to a question about dnsmasq - libvirt uses dnsmasq for DNS, DHCP
(v4 and v6), and RA. I've just noticed that when I enable dhcpv6,
clients are no longer able to get an IPv6 via autoconf (i.e. when
they're configured to only use autoconf). Is this expected, or a
bug/configuration problem?

This is my dnsmasq version: dnsmasq-2.72-3.fc21.x86_64

The dnsmasq commandline:

/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/ipv6.conf
--leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper

and ipv6.conf:

strict-order
domain=test.lainetest.org
expand-hosts
pid-file=/var/run/libvirt/network/ipv6.pid
except-interface=lo
bind-dynamic
interface=virbr1
dhcp-range=192.168.123.2,192.168.123.254
dhcp-no-override
dhcp-range=x:x:x:x::2,x:x:x:x::200
dhcp-lease-max=764
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/ipv6.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/ipv6.addnhosts
enable-ra

This is the config file when there is no dhcp-range defined for the network:

strict-order
domain=test.lainetest.org
expand-hosts
pid-file=/var/run/libvirt/network/ipv6.pid
except-interface=lo
bind-dynamic
interface=virbr1
dhcp-range=192.168.123.2,192.168.123.254
dhcp-no-override
dhcp-lease-max=253
dhcp-hostsfile=/var/lib/libvirt/dnsmasq/ipv6.hostsfile
addn-hosts=/var/lib/libvirt/dnsmasq/ipv6.addnhosts
dhcp-range=x:x:x:x::1,ra-only

(in this case, autoconf works correctly).



More information about the Dnsmasq-discuss mailing list