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

Simon Kelley simon at thekelleys.org.uk
Fri Mar 27 20:50:44 GMT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 27/03/15 19:51, Laine Stump wrote:
> (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?

No. Getting more that one address from DHCPv4 would be difficult, but
a DHCPv4 address and a static IPv4 address just needs client support.
IPv4 has not generally handled multiple addresses, so support is
difficult.

DHCPv6 can provide as many addresses as the client wants - it just
needs to provide a unique IAID each time it wants a new address allocate
d.

> 
> 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?

Config problem. enable-ra does what it says, but the default is to
advertise the router, and set the bits which tell clients to use
DHCPv6, and NOT stateless autoconf ie it does just enough to make
DHCPv6 work.

What you need is the first config, but delete enable-ra, and change
the dhcp-range line to

dhcp-range=x:x:x:x::2,x:x:x:x::200,slaac

Cheers,

Simon.



> 
> 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).
> 
> _______________________________________________ Dnsmasq-discuss 
> mailing list Dnsmasq-discuss at lists.thekelleys.org.uk 
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlUVwqQACgkQKPyGmiibgrcaEgCfXiJ6SqtEaOBlVkFFpO2dcrIT
TNAAn3+diqZiBTX6wOsjtpi7GWjbvogo
=IM+m
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list