Discussion:
DHCPv6 options to lease
Markus Varjola
2014-01-30 07:35:57 UTC
Permalink
Hello.
If anyone has managed to write something additional to the dhcpd6.lease file could you postan example of how you did it?
We have been having some major problems achieving this. We are using the latest 4.3.0rc1and have managed to log some of the important options with v6relay command, but gettingsomething into the lease file other than the normal output has been a failure.
Other viable solution would be to build a lease like file by outputting some of the logging informationto a different file, but achieving that has also eluded us.
The unfortunate part is that we can not take IPv6 into production until the right conditions are metand logging certain options is a necessity.
So anyone? Any real working examples of gathering dhcp6.options to the lease file or some otherpermanent record?
Thanks in advance.
-Markus Varjola
espen.tallaksen
2014-01-30 09:45:14 UTC
Permalink
Hi
I did it like this (see under), docsis-things might not be applicable to
you. Maybe you want/need to remove or change it to something else. This
config is actually running on the alfa release as of today. It will do both
logging and set some additional attributes to the object in the lease-file.

on commit {
if option dhcp6.ia-na = option dhcp6.ia-na{
set iana = binary-to-ascii(16,16,":",substring(suffix(option
dhcp6.ia-na,24),0,16));
}
if option dhcp6.ia-pd = option dhcp6.ia-pd{
set iapd = binary-to-ascii(16,16,":", suffix(option
dhcp6.ia-pd,16));
set pdsize = binary-to-ascii(10,8,":",substring(suffix(option
dhcp6.ia-pd,17),0,1));
}

set cm = v6relay(1, (binary-to-ascii(16, 8, ":", option
docsis.cm-mac-address)));
set ifname = v6relay(1, option dhcp6.interface-id);
set lla = (binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6)));

if option dhcp6.ia-na = option dhcp6.ia-na{
log(info, concat("ONCOMMIT IA_NA: ", iana, " To: ", lla, " CM-mac: ", cm, "
INT: ", ifname));
}
if option dhcp6.ia-pd = option dhcp6.ia-pd{
log(info, concat("ONCOMMIT IA_PD: ", iapd, "/", pdsize, " To: ", lla, "
CM-mac: ", cm, " INT: ", ifname));
}
}


BestRegards
Espen Tallaksen


On Thu, Jan 30, 2014 at 8:35 AM, Markus Varjola <***@varjola.net> wrote:

> Hello.
>
> If anyone has managed to write something additional to the dhcpd6.lease
> file could you post
> an example of how you did it?
>
> We have been having some major problems achieving this. We are using the
> latest 4.3.0rc1
> and have managed to log some of the important options with v6relay
> command, but getting
> something into the lease file other than the normal output has been a
> failure.
>
> Other viable solution would be to build a lease like file by outputting
> some of the logging information
> to a different file, but achieving that has also eluded us.
>
> The unfortunate part is that we can not take IPv6 into production until
> the right conditions are met
> and logging certain options is a necessity.
>
> So anyone? Any real working examples of gathering dhcp6.options to the
> lease file or some other
> permanent record?
>
> Thanks in advance.
>
> -Markus Varjola
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-***@lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
Markus Varjola
2014-01-30 10:56:40 UTC
Permalink
You Sir, are awesome.
I hereby declare our utmost appreciation for you.
-Markus Varjola
Date: Thu, 30 Jan 2014 10:45:14 +0100
Subject: Re: DHCPv6 options to lease
From: ***@gmail.com
To: dhcp-***@lists.isc.org

HiI did it like this (see under), docsis-things might not be applicable to you. Maybe you want/need to remove or change it to something else. This config is actually running on the alfa release as of today. It will do both logging and set some additional attributes to the object in the lease-file.

on commit { if option dhcp6.ia-na = option dhcp6.ia-na{ set iana = binary-to-ascii(16,16,":",substring(suffix(option dhcp6.ia-na,24),0,16));
} if option dhcp6.ia-pd = option dhcp6.ia-pd{ set iapd = binary-to-ascii(16,16,":", suffix(option dhcp6.ia-pd,16));
set pdsize = binary-to-ascii(10,8,":",substring(suffix(option dhcp6.ia-pd,17),0,1)); }

set cm = v6relay(1, (binary-to-ascii(16, 8, ":", option docsis.cm-mac-address))); set ifname = v6relay(1, option dhcp6.interface-id);
set lla = (binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6)));
if option dhcp6.ia-na = option dhcp6.ia-na{
log(info, concat("ONCOMMIT IA_NA: ", iana, " To: ", lla, " CM-mac: ", cm, " INT: ", ifname)); }
if option dhcp6.ia-pd = option dhcp6.ia-pd{ log(info, concat("ONCOMMIT IA_PD: ", iapd, "/", pdsize, " To: ", lla, " CM-mac: ", cm, " INT: ", ifname));
} }

BestRegardsEspen Tallaksen


On Thu, Jan 30, 2014 at 8:35 AM, Markus Varjola <***@varjola.net> wrote:




Hello.
If anyone has managed to write something additional to the dhcpd6.lease file could you postan example of how you did it?
We have been having some major problems achieving this. We are using the latest 4.3.0rc1
and have managed to log some of the important options with v6relay command, but gettingsomething into the lease file other than the normal output has been a failure.
Other viable solution would be to build a lease like file by outputting some of the logging information
to a different file, but achieving that has also eluded us.
The unfortunate part is that we can not take IPv6 into production until the right conditions are metand logging certain options is a necessity.

So anyone? Any real working examples of gathering dhcp6.options to the lease file or some otherpermanent record?
Thanks in advance.

-Markus Varjola

_______________________________________________

dhcp-users mailing list

dhcp-***@lists.isc.org

https://lists.isc.org/mailman/listinfo/dhcp-users
Loading...