On Wed, Jan 22, 2020 at 12:31:16AM +0100, Harald Jensås wrote: > On Tue, 2020-01-21 at 23:38 +0100, Tore Anderson wrote: > > * Simon Kelley > > > > > I have an alternative suggestion for the syntax of dhcp-host. > > > It's less flexible, but simpler and easier to understand and to > > > explain, > > > and uses existing semantics rather than adding new keywords. > > > > > > The idea is just to add a prefix-length to the address. That allows > > > you > > > to define (eg) 1,2,4,8, or 16 addresses for use by a host simply > > > and > > > easily in a way which makes it difficult to accidentally overlap > > > address > > > ranges, and is fairly obvious to anyone who has done done any IPv6 > > > network configuration. > > > > > > for instance to reserve four addresses for each host we cold do: > > > > > > dhcp-host=00:11:22:33:44:55,[fd12:3456::aa00/62] > > > dhcp-host=00:11:22:33:44:56,[fd12:3456::aa04/62] > > > dhcp-host=00:11:22:33:44:57,[fd12:3456::aa08/62] > > > > > > As a sanity check, if the "host part" of the address isn't zero, > > > > > > ie [fd12:3456::aa01/62] > > > > > > that could be rejected with an error. > > I like the idea of using a prefix. I have a new revision of the patch > with this implemented at the bottom of this e-mail. It's far better and > more flexible than the keywords approach I came up with initially, as > it's now possible to mix individual addreses, prefixed ranges and > prefixed wildcard addresses etc. > > # A list of addressses > dhcp-host=52:54:00:3f:5c:c0,[fd12:3456:789a:1::aa02][fd12:3456:789a:1::aa04][fd12:3456:789a:1::aa06],host1 > > # Mixing a prefix and a single address > dhcp-host=52:54:00:3f:5c:c0,[fd12:3456:789a:1::aa04/62][fd12:3456:789a:1::aa00],host1 > > # Prefixed wildcard > dhcp-host=52:54:00:3f:5c:c0,[::aa04/62],host1 > > > > I have done quite a bit of IPv6 networking, but the use of /62 here > > is anything but «fairly obvious» to me. > > > > It would have been much more intuitive to use /126, in my opinion.
+1 > > > > Tore > > > > I too found it a bit curios with /62 at first, :-) > as I understand it the interface identifier is always the 64 least > significant bit's in IPv6 ref[1]. Comparing apples and oranges. An IPv6 address with it's prefix is not the same as some syntax that describes several IPv6 addresses. > I think changing the patch to use the full 128 bit's as a mask is > trivial. We may also support both by subtracting 64 from any prefix > larger than 64 in the code? What with prefixes smaller as 64 e.g. 48? > So /126 and /62 yield the same result. Please, pretty please, keep ambiguity away from computers. > What does other people think? } What do other people think? > > [1] > https://en.wikipedia.org/wiki/IPv6_address#Unicast_and_anycast_address_format > > > > > From a69c6400454cdf036808a0a40ac033688387f20d Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?Harald=20Jens=C3=A5s?= <hjen...@redhat.com> > Date: Mon, 13 Jan 2020 19:44:43 +0100 > Subject: [PATCH] DHCPv6 - List and Range reservation for single host > [ ... commit message, git statistics ... ] > > diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 > index cb5cc73..57003d7 100644 > --- a/man/dnsmasq.8 > +++ b/man/dnsmasq.8 > @@ -1079,6 +1079,22 @@ work reliably if only one of the hardware addresses is > active at any > time and there is no way for dnsmasq to enforce this. It is, for instance, > useful to allocate a stable IP address to a laptop which > has both wired and wireless interfaces. > + > +For DHCPv6 it is possible to provide multiple IPv6 addresses for a single > +dhcp-host. It is also possible to use a prefix in the configuration to > +set up a range of addresses. For example: > +\fB--dhcp-host=52:54:00:3f:5c:c0,[fd12:3456::aa02][fd12:3456::aa04],host1\fP > +will make the two addresses \fBfd12:3456::aa02\fP and \fBfd12:3456::aa04\fP > +available to the host with hardware address 52:54:00:3f:5c:c0. > +\fB--dhcp-host=52:54:00:3f:5c:c0,[fd12:3456::aa00/62],host1\fP +\fB--dhcp-host=52:54:00:3f:5c:c0,[fd12:3456::aa00/126],host1\fP > +will make the range of 4 addresses between the base address (fd12:3456::aa00) > +and the end address (fd12:3456::aa03) available to the host with hardware > +address 52:54:00:3f:5c:c0. Multiple non-prefixed, prefixed or prefixed > +wildcard addresses with only the host-identifier part can be mixed, eg: > +\fB--dhcp-host=52:54:00:3f:5c:c0,[::aa03][::aa04/63][::aa08/62],host1\fP. +\fB--dhcp-host=52:54:00:3f:5c:c0,[::aa03][::aa04/127][::aa08/126],host1\fP. > +Providing multiple addresses is useful for network booting where individual > +boot stages will request addresses with different IAID's. > + > .TP > .B --dhcp-hostsfile=<path> > Read DHCP host information from the specified file. If a directory Groeten Geert Stappers -- Leven en laten leven
signature.asc
Description: PGP signature
_______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss