JC, et. al.,
So I've now tested a config stanza extensively for
ISC-DHCPD that works well, and tests just for the local bit.
For those that just want to implement it, here's the stanza to
put in your subnet definitions to modify the lease time for
leases with the local bit on in the client's MAC address:
if (substring(reverse(1,binary-to-ascii(2, 8, ":",
substring(hardware,1,1))), 1, 1) = "1") {
default-lease-time 1800;
}
else {
default-lease-time 14400;
}
This works well, and is minimally invasive.
Here's the debug version I used to get it right, with
comments explaining all the pieces:
# Grab the first byte of the MAC address
set bytemac = substring(hardware,1,1);
# Strictly for logging (printing)
set byteprt = binary-to-ascii(16,8,":", bytemac);
# Make it binary so we can select the bit in question
set binmac = binary-to-ascii(2, 8, ":", bytemac);
# isc-dhcp-server truncates leading zeros, so we need to
reverse the string, then the local bit is the second
set localbit = substring(reverse(1,binmac), 1, 1);
# Log it to see if it's right...
if localbit = "1" {
log (error, concat("dhcpd local bit, bytemac:
.",byteprt,". binmac: .", binmac, "., localbit: .", localbit,
"."));
}
I'm comfortable using this on all the subnets, so I'm
recommending we modify the experiment at the next IETF
meeting in Dallas to allow MAC address randomization on all
user subnets.
I'm not planning on being at the IEEE meeting coming up,
so I'll leave it up to those that will whether you want to
give this a go.
I may be able to join the call tomorrow, if things here
continue to go well.
Enjoy!
Chris.