How to access delegated prefix

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to access delegated prefix

André Keller
Hi,

I'm struggling in accessing the delegated prefix to use in a log statement.

Log:
Oct  1 15:17:23 dhcp dhcpd[18161]: Relay-forward message from
2001:db8:ffff:c::195 port 547, link address ::, peer address
fe80::a9ab:abff:fe42:8cd2
Oct  1 15:17:23 dhcp dhcpd[18161]: [L2 Relay] No link address in relay
packet assuming L2 relay and using receiving interface
Oct  1 15:17:23 dhcp dhcpd[18161]: Reply PD: address
2001:db8:123f:f600::/56 to client with duid
00:03:00:01:ab:ab:ab:42:8c:d2 iaid = 2034404562 valid for 300 seconds


I'd like to access the 2001:db8:123f:f600::/56 for another log message
(I'd like to print the v6relay(0, option dhcp6.interface-id) along with it.

What I came up with so far:

on commit {
        log(info, concat("IPv6 requested: ", binary-to-ascii (16, 16,
":", suffix(option dhcp6.ia-pd, 16)), "/", binary-to-ascii(10, 8, ":",
substring(suffix(option dhcp6.ia-pd, 17), 0, 1)), " / Port: ",
v6relay(0, option dhcp6.interface-id)));
    }

This will log the IP address requested by the client. This address does
not necessarily match the Reply sent by the server (especially for the
initial allocation, the client will send ::/0).

Any idea how I can access the PD reply sent by the server?


Regards
André
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to access delegated prefix

Mike-2
On 10/1/2016 9:26 AM, André Keller wrote:

> Hi,
>
> I'm struggling in accessing the delegated prefix to use in a log statement.
>
> Log:
> Oct  1 15:17:23 dhcp dhcpd[18161]: Relay-forward message from
> 2001:db8:ffff:c::195 port 547, link address ::, peer address
> fe80::a9ab:abff:fe42:8cd2
> Oct  1 15:17:23 dhcp dhcpd[18161]: [L2 Relay] No link address in relay
> packet assuming L2 relay and using receiving interface
> Oct  1 15:17:23 dhcp dhcpd[18161]: Reply PD: address
> 2001:db8:123f:f600::/56 to client with duid
> 00:03:00:01:ab:ab:ab:42:8c:d2 iaid = 2034404562 valid for 300 seconds
>
>
> I'd like to access the 2001:db8:123f:f600::/56 for another log message
> (I'd like to print the v6relay(0, option dhcp6.interface-id) along with it.
>
> What I came up with so far:
>
> on commit {
>         log(info, concat("IPv6 requested: ", binary-to-ascii (16, 16,
> ":", suffix(option dhcp6.ia-pd, 16)), "/", binary-to-ascii(10, 8, ":",
> substring(suffix(option dhcp6.ia-pd, 17), 0, 1)), " / Port: ",
> v6relay(0, option dhcp6.interface-id)));
>     }
>
> This will log the IP address requested by the client. This address does
> not necessarily match the Reply sent by the server (especially for the
> initial allocation, the client will send ::/0).
>
> Any idea how I can access the PD reply sent by the server?


I obtain the PD delegated by using the environment variables passed in
to the dhclient-exit-hooks script.


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to access delegated prefix

André Keller
Hi Mike,

On 03.10.2016 21:05, Mike wrote:
> On 10/1/2016 9:26 AM, André Keller wrote:
>> Any idea how I can access the PD reply sent by the server?
>
> I obtain the PD delegated by using the environment variables passed in
> to the dhclient-exit-hooks script.

I have no dhclient running. I need to have this information available on
the dhcp server handing out the prefix.


Regards
André
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users