-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsmasq: Add full dhcp-host support for IPv4 and IPv6 #8497
Conversation
First of all, thanks a ton for implementing this so quickly. Quick question: _From the manpage.._ A single --dhcp-host may contain an IPv4 address or one or more IPv6 addresses, or both. IPv6 addresses must be bracketed by square brackets thus: --dhcp-host=laptop,[1234::56] IPv6 addresses may contain only the host-identifier part: --dhcp-host=laptop,[::56] in which case they act as wildcards in constructed DHCP ranges, with the appropriate network part inserted. For IPv6, an address may include a prefix length: --dhcp-host=laptop,[1234:50/126] which (in this case) specifies four addresses, 1234::50 to 1234::53. This (an the ability to specify multiple addresses) is useful when a host presents either a consistent name or hardware-ID, but varying DUIDs, since it allows dnsmasq to honour the static address allocation but assign a different adddress for each DUID. |
@gspannu As |
Strictly speaking it’s a reserved/deprecated IPv6 range that doesn’t exist in the real world😉 https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml |
e2fa9f2
to
13916e4
Compare
All dhcp-host entries must have only unique IP addresses. Otherwise dnsmasq has a hard error that prevents it to start. I will add a draft for an additional validation that triggers when:
dns overrides do not have to be unique, so the validation specifically targets only dhcp-host |
… choice without hostname defined.
o fix possible race condition in validations o simplify jinja template
@AdSchellevis Just tested it and everything still works. So in it goes. Thank you for your help :) |
Fixes: #8487
Directive:
https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
This should almost fully satisfy the requirements of the man page regarding this directive.
Test dataset:
Result:
/usr/local/etc/dnsmasq.conf
/var/etc/dnsmasq-hosts