Missing option-82 log if "no free leases"
Henrik Sterndorff Jessen
hsj at mvb.dk
Tue May 29 19:14:35 UTC 2007
Hi,
I am using dhcp to dish out fixed addresses to users. All users are
connected to cisco switch ports that act as a relay and therefore add
option-82 information to the dhcp query. I don't know the mac addresses
of the users.
I am assigning a fixed address to each user using a pool of 1 ip address
(see code below). This gives me the problem, that there are "no free
leases" if the user changes hardware. This is a well known problem that
has been discussed extensively on this list.
I would like to at least see from the dhcp log the option-82 attributes
that have been "dropped" by the server. By I only get a
"DHCPDISCOVER from 00:0d:da:01:0d:dd via 10.0.0.1: network 10.0.0/24: no
free leases"
And no more log from that mac address. I get log entries from all
addresses that are offered by the server.
The configuration is:
class "myClass" { match if (substring ((option agent.circuit-id),4,2) =
09:02); }
subnet 10.0.0.0 netmask 255.255.255.0 {
option routers 10.0.0.1;
pool { allow members of "myClass"; range 10.0.0.5 10.0.0.5; }
}
##
## Logging:
##
if exists agent.circuit-id
{
set ClientMAC = binary-to-ascii (16, 8, ":", substring
(hardware, 1, 6));
set Vlan = binary-to-ascii (10, 16, "", substring( option
agent.circuit-id, 2, 2));
set SwitchMac = binary-to-ascii(16, 8, ":", substring( option
agent.remote-id, 2, 6));
set LeasedIP = binary-to-ascii (10, 8, ".", leased-address);
set SwitchSlot = binary-to-ascii (10, 8, "", substring ( option
agent.circuit-id, 4,1));
set SwitchPort = binary-to-ascii (10, 8, "", substring ( option
agent.circuit-id, 5,1));
log ( info,
concat("BEGIN|",SwitchMac,"|",SwitchSlot,"|",SwitchPort,"|",Vlan,"|",Cli
entMac,"|",LeasedIP,"|END"));
}
##
I've been troubled by the "no free leases" for a while. And my last
option is writing a script that automatically removes the lease when a
"no free lease" appears in the log. But I need to know the option-82
attributes from the offending client to do that.
Does anyone know a patch to dhcpd that ignores the "hardware" part in
the lease when assigning IP's from a pool? This will of cause also solve
the problem. And yes - I know this is against the RFC's :)
Please help - or I'll have to move to Cisco's CNR :)
Regards
Henrik
More information about the dhcp-users
mailing list