"raw packet not available" when execute() on release (solved)
Nicolas C.
dhcp at nryc.fr
Thu May 3 13:38:19 UTC 2012
Le 03/05/2012 11:46, Niall O'Reilly a écrit :
>
> On 1 May 2012, at 16:52, Nicolas C. wrote:
>
>> The problem is that I really need the IPv4 address and the hardware address, I found a workaround by registering a TXT record to store them but it would be so much easier if I had them directly.
>
> I have a trick for storing request-time data in the lease object.
> This allows me to tag leases for later statistical analysis.
>
> NB! I have no idea whether this will be useful for what you need.
>
> What I do is to set a variable from a request option by coding a
> global configuration command such as the following.
>
> set vendor-string = option vendor-class-identifier;
>
> By using several such commands (some with shared-network or subnet scope),
> I can obtain potentially useful tags in the lease object.
>
> lease 137.43.175.156 {
> starts 5 2011/05/20 17:43:09;
> ends 5 2011/05/20 17:45:09;
> tstp 5 2011/05/20 17:45:09;
> cltt 5 2011/05/20 17:43:09;
> binding state free;
> hardware ethernet [none of your business];
> set vendor-string = "dhcpcd 4.0.15";
> set link-label = "ucd-guest";
> set subnet-prefix = "137.43.175.0/24";
> set pool-label = "ucd_guest_l1";
> }
>
> I hope this helps.
Hello,
Your reply was helpful. Instead of using TXT records, I simply created
two new dhcp options to store what I needed. This is much simpler and
works like a charm :
# Declared globally
option cache-ipv4 code 190 = text;
option cache-mac code 191 = text;
# Declared in the subnet
set cache-ipv4 = binary-to-ascii(10, 8, ".", leased-address);
set cache-mac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
on expiry {
execute (
"/usr/local/bin/ddns-ipv6",
prefix,
"-d",
ddns-hostname,
cache-mac,
cache-ipv4
);
}
Thanks!
Nicolas
More information about the dhcp-users
mailing list