+++ This bug was initially created as a clone of Bug #1575026 +++
Description of problem:
While network booting with DHCPv6 and chain loading from PXE to iPXE, dnsmasq refuses to hand out a static IP when the DHCPv6 clid or iaid changes.
This prevents a static ip from being used for PXE or iPXE booting. During the boot process PXE will send out a DHCPREQUEST and get an IP address, then after chainloading to iPXE the clid and iaid change (as they are generated with a different algorithm) and dnsmasq responds with "no addresses available", the same thing will then happen when the OS takes over and another different algorithm is used.
As a test removing the check in check_address (rfc3315.c), gets rid of the problem.
Version-Release number of selected component (if applicable):
dnsmasq-2.76-5.el7.x86_64
How reproducible:
Every time
Steps to Reproduce:
I'm encoutering this problem in openstack but have isolated the problem out to be reproduced with the following configs
==== addn_hosts
fd00:1101::0101 host101
fd00:1101::0102 host102
==== boot.ipxe
#!ipxe
set base http://[fd00:1101::0002]
kernel ${base}/vmlinuz initrd=centos_initrd_ipv6.img rdinit=/usr/sbin/init
initrd ${base}/centos_initrd_ipv6.img
boot
==== dnsmasq.conf
dhcp-match=ipxe,175
dhcp-option-force=26,1450
dhcp-userclass=set:ipxe6,iPXE
dhcp-vendorclass=set:ipxe6,HTTP
dhcp-option=tag:!ipxe6,option6:bootfile-url,tftp://[fd00:1101::0002]/ipxe.efi
dhcp-option=tag:ipxe6,option6:bootfile-url,http://[fd00:1101::0002]/ipv6/boot.ipxe
==== host
fa:16:3e:fe:87:61,host101,[fd00:1101::0101]
fa:16:3e:ed:ad:d4,host102,[fd00:1101::0102]
==== run-dnsmasq
#!/bin/bash -x
sudo rm /var/lib/dnsmasq/dnsmasq.leases
sudo dnsmasq \
-d --log-queries --log-dhcp \
--no-hosts --no-resolv --strict-order --except-interface=lo --bind-interfaces --interface=eth1 \
--conf-file=/var/www/html/ipv6/dnsmasq.conf \
--addn-hosts=/var/www/html/ipv6/addn_hosts \
--dhcp-hostsfile=/var/www/html/ipv6/host --dhcp-range=set:tag0,fd00:1101::,static,64,86400s
==== /etc/radvd.conf
interface eth1
{
AdvManagedFlag on;
AdvSendAdvert on;
AdvOtherConfigFlag on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 60;
};
More info can be found here from when I last looked at this problem,
http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2017q1/011267.html
I'm currently looking at the solution proposed in that thread to make dhcp-host be conditional but in the mean time am filing this bugzilla as others may hit the problem
Actual results:
$ ./run-dnsmasq |& grep -e client-id -e IAID -e iaaddr -e http -e "no add" -e DHCP
dnsmasq: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify
dnsmasq-dhcp: DHCPv6, static leases only on fd00:1101::, lease time 1d
dnsmasq-dhcp: DHCP, sockets bound exclusively to interface eth1
dnsmasq-dhcp: 11337181 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15209603 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15209603 DHCPSOLICIT(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4
dnsmasq-dhcp: 15209603 DHCPADVERTISE(eth1) fd00:1101::102 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4 host102
dnsmasq-dhcp: 15209603 sent size: 18 option: 1 client-id 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e...
dnsmasq-dhcp: 15209603 sent size: 40 option: 3 ia-na IAID=4018141183 T1=43200 T2=75600
dnsmasq-dhcp: 15209603 nest size: 24 option: 5 iaaddr fd00:1101::102 PL=86400 VL=86400
dnsmasq-dhcp: 15275139 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15275139 DHCPSOLICIT(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4
dnsmasq-dhcp: 15275139 DHCPADVERTISE(eth1) fd00:1101::102 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4 host102
dnsmasq-dhcp: 15275139 sent size: 18 option: 1 client-id 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e...
dnsmasq-dhcp: 15275139 sent size: 40 option: 3 ia-na IAID=3980328959 T1=43200 T2=75600
dnsmasq-dhcp: 15275139 nest size: 24 option: 5 iaaddr fd00:1101::102 PL=86400 VL=86400
dnsmasq-dhcp: 15340675 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15340675 DHCPREQUEST(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4
dnsmasq-dhcp: 15340675 DHCPREPLY(eth1) fd00:1101::102 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4 host102
dnsmasq-dhcp: 15340675 sent size: 18 option: 1 client-id 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e...
dnsmasq-dhcp: 15340675 sent size: 40 option: 3 ia-na IAID=3980328959 T1=43200 T2=75600
dnsmasq-dhcp: 15340675 nest size: 24 option: 5 iaaddr fd00:1101::102 PL=86400 VL=86400
dnsmasq-dhcp: 15406211 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15406211 DHCPREQUEST(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4
dnsmasq-dhcp: 15406211 DHCPREPLY(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4 no addresses available
dnsmasq-dhcp: 15406211 sent size: 18 option: 1 client-id 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e...
dnsmasq-dhcp: 15406211 sent size: 32 option: 3 ia-na IAID=4018141183 T1=4294967295 T2=4294967295
dnsmasq-dhcp: 15406211 sent size: 24 option: 13 status 2 no addresses available
dnsmasq-dhcp: 15406211 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15406211 DHCPREQUEST(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4
dnsmasq-dhcp: 15406211 DHCPREPLY(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4 no addresses available
dnsmasq-dhcp: 15406211 sent size: 18 option: 1 client-id 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e...
dnsmasq-dhcp: 15406211 sent size: 32 option: 3 ia-na IAID=4018141183 T1=4294967295 T2=4294967295
dnsmasq-dhcp: 15406211 sent size: 24 option: 13 status 2 no addresses available
dnsmasq-dhcp: 15406211 available DHCPv6 subnet: fd00:1101::/64
dnsmasq-dhcp: 15406211 DHCPREQUEST(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4
dnsmasq-dhcp: 15406211 DHCPREPLY(eth1) 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e:58:a6:03:e4 no addresses available
dnsmasq-dhcp: 15406211 sent size: 18 option: 1 client-id 00:04:7b:ca:f3:ce:16:8f:63:4a:ad:20:fe:7e...
dnsmasq-dhcp: 15406211 sent size: 32 option: 3 ia-na IAID=4018141183 T1=4294967295 T2=4294967295
dnsmasq-dhcp: 15406211 sent size: 24 option: 13 status 2 no addresses available
Expected results:
A statis IP to be handed out in place of "no addresses available"
--- Additional comment from Harald Jensås on 2019-11-20 14:52:43 CET ---
This change should fix this issue: http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2018q4/012707.html
I have verified that it works in a non OSP test environment when building dnsmasq from upstream git + ^^ patch applied.
With the below configuration, the log's below show that the client with mac: 52:54:00:3f:5c:c0 get fd12:3456:789a:1::aacc every time despite the IAID changeing.
/etc/dnsmasq.conf
port=0
interface=eth1
log-dhcp
dhcp-range=set:ctlplane-subnet,fd12:3456:789a:1::aaaa,fd12:3456:789a:1::afff,static,64
dhcp-host=52:54:00:bc:c3:fd,[fd12:3456:789a:1::aabb],static
dhcp-host=52:54:00:3f:5c:c0,[fd12:3456:789a:1::aacc],static
dhcp-option-force=tag:ctlplane-subnet,option:mtu,1450
dhcp-sequential-ip
dhcp-match=ipxe,175
dhcp-match=set:efi,option:client-arch,7
dhcp-match=set:efi,option:client-arch,9
dhcp-match=set:efi,option:client-arch,11
# dhcpv6s for Client System Architecture Type (61)
dhcp-match=set:efi6,option6:61,0007
dhcp-match=set:efi6,option6:61,0009
dhcp-match=set:efi6,option6:61,0011
dhcp-userclass=set:ipxe6,iPXE
# Client is already running iPXE; move to next stage of chainloading
dhcp-boot=tag:ipxe,http://[fd12:3456:789a:1::1]:/inspector.ipxe
dhcp-option=tag:ipxe6,option6:bootfile-url,http://[fd12:3456:789a:1::1]/inspector.ipxe
# Client is PXE booting over EFI without iPXE ROM; send EFI version of iPXE chainloader
dhcp-boot=tag:efi,tag:!ipxe,ipxe.efi
dhcp-option=tag:efi6,tag:!ipxe6,option6:bootfile-url,tftp://[fd12:3456:789a:1::1]/ipxe.efi
# Client is running PXE over BIOS; send BIOS version of iPXE chainloader
dhcp-boot=undionly.kpxe,localhost.localdomain,fd12:3456:789a:1::1
Nov 20 14:45:52 dhcpv6-server.lab.example.com dnsmasq[1301]: started, version 2.80-93-g6ebdc95 DNS disabled
Nov 20 14:45:52 dhcpv6-server.lab.example.com dnsmasq[1301]: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify dumpfile
Nov 20 14:45:52 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: DHCPv6, static leases only on fd12:3456:789a:1::afff, lease time 1h
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 available DHCPv6 subnet: fd12:3456:789a:1::aaaa/64
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 client MAC address: 52:54:00:3f:5c:c0
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 DHCPSOLICIT(eth1) 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 DHCPADVERTISE(eth1) fd12:3456:789a:1::aacc 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c static
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 requested options: 23:dns-server
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 tags: ctlplane-subnet, known, dhcpv6, eth1
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 sent size: 18 option: 1 client-id 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0...
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 sent size: 14 option: 2 server-id 00:01:00:01:25:65:f3:ba:52:54:00:b5:b2:8f
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 sent size: 40 option: 3 ia-na IAID=1073085951 T1=1800 T2=3150
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 nest size: 24 option: 5 iaaddr fd12:3456:789a:1::aacc PL=3600 VL=3600
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 sent size: 9 option: 13 status 0 success
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 sent size: 1 option: 7 preference 0
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16476418 sent size: 8 option: 39 FQDN static
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 available DHCPv6 subnet: fd12:3456:789a:1::aaaa/64
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 client MAC address: 52:54:00:3f:5c:c0
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 DHCPREQUEST(eth1) 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 DHCPREPLY(eth1) fd12:3456:789a:1::aacc 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c static
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 requested options: 23:dns-server
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 tags: ctlplane-subnet, known, dhcpv6, eth1
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 sent size: 18 option: 1 client-id 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0...
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 sent size: 14 option: 2 server-id 00:01:00:01:25:65:f3:ba:52:54:00:b5:b2:8f
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 sent size: 40 option: 3 ia-na IAID=1073085951 T1=1800 T2=3150
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 nest size: 24 option: 5 iaaddr fd12:3456:789a:1::aacc PL=3600 VL=3600
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 sent size: 9 option: 13 status 0 success
Nov 20 14:46:04 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16541954 sent size: 8 option: 39 FQDN static
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 available DHCPv6 subnet: fd12:3456:789a:1::aaaa/64
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 vendor class: 343
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 client MAC address: 52:54:00:3f:5c:c0
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 DHCPSOLICIT(eth1) 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 DHCPADVERTISE(eth1) fd12:3456:789a:1::aacc 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c static
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 requested options: 59:bootfile-url, 60:bootfile-param, 23:dns-server,
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 requested options: 16:vendor-class
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 tags: ctlplane-subnet, known, efi6, dhcpv6, eth1
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 18 option: 1 client-id 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0...
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 14 option: 2 server-id 00:01:00:01:25:65:f3:ba:52:54:00:b5:b2:8f
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 40 option: 3 ia-na IAID=1070136446 T1=1800 T2=3150
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 nest size: 24 option: 5 iaaddr fd12:3456:789a:1::aacc PL=3600 VL=3600
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 9 option: 13 status 0 success
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 1 option: 7 preference 0
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 37 option: 59 bootfile-url tftp://[fd12:3456:789a:1::1]/ipxe.efi
Nov 20 14:47:02 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16607490 sent size: 8 option: 39 FQDN static
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 available DHCPv6 subnet: fd12:3456:789a:1::aaaa/64
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 vendor class: 343
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 client MAC address: 52:54:00:3f:5c:c0
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 DHCPREQUEST(eth1) 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 DHCPREPLY(eth1) fd12:3456:789a:1::aacc 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0:4f:57:ed:5c static
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 requested options: 59:bootfile-url, 60:bootfile-param, 23:dns-server,
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 requested options: 16:vendor-class
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 tags: ctlplane-subnet, known, efi6, dhcpv6, eth1
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 sent size: 18 option: 1 client-id 00:04:90:b3:fe:05:c8:ed:73:42:a5:7d:55:a0...
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 sent size: 14 option: 2 server-id 00:01:00:01:25:65:f3:ba:52:54:00:b5:b2:8f
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 sent size: 40 option: 3 ia-na IAID=1070136446 T1=1800 T2=3150
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 nest size: 24 option: 5 iaaddr fd12:3456:789a:1::aacc PL=3600 VL=3600
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 sent size: 9 option: 13 status 0 success
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 sent size: 37 option: 59 bootfile-url tftp://[fd12:3456:789a:1::1]/ipxe.efi
Nov 20 14:47:07 dhcpv6-server.lab.example.com dnsmasq-dhcp[1301]: 16673026 sent size: 8 option: 39 FQDN static
--- Additional comment from Harald Jensås on 2019-11-21 17:23:27 CET ---
This is a version of the patch proposed by Pali Rohár on Dnsmasq-discuss[1] on top of dnsmasq-2.76. With this change I was able to boot iPXE->Ironic-IPA->Deploy instance without running into the "no addresses available" issue.
[1] http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2018q4/012707.html
--- Additional comment from Bob Fournier on 2019-12-03 15:05:55 CET ---
Note I've also seen this issue just with PXE. The flow is like this:
UEFI PXE client sends a Solicit with DNS option request
Dnsmasq responds with IPv6 address and DNS option response
UEFI PXE client sends a 2nd solicit with BootUrl and BootFileParamaters option requests and a different IAID
Dnsmasq responds with "no addresses available"
Comment 1Fedora Update System
2020-03-12 22:59:06 UTC