ipv6: logging option docsis.cm-mac-address (4491 / 17 / 1026)

Shawn Routhier sar at isc.org
Thu Jul 21 02:50:44 UTC 2016


While looking at a bug report I looked at the message chain for logging the
cm-mac-address from a received packet.  As it didn’t get an explanation
then I thought adding one now might be useful both in general and for people
who search the archives.

For those people trying to access any option that a DHCPv6 relay has added
to the message you must notice that for relays V6 is a good bit different than V4.
In V4 a relay will simply insert any additional options in the message as sent
from the client.  In V6 a relay will encapsulate the client’s message into an option
in a new message and then add any extra items as options in the new message.
Additional relays can continue this type of encapsulation for up to 32 levels according
to the specification.

When you have the server attempt to access an option from the message it will look
for that option in the message sent from the client (the inner most encapsulation).  If
you wish to access an option that a V6 relay has added you need to indicate that you
want an option from the relays and which relay you are examining.  The v6relay() function
is used for this, It includes a number indicating which relay to examine
(1 is closest to the client).  For example:

log(info, binary-to-ascii(16, 8, ":", substring(v6relay(1, option docsis.relay-agent), 0, 6)));

would look for the docsis.relay-agent option (which you would need to define, in my
test this was the name I gave to option 1026) in the set of options added by the relay
agent closest to the client (the 1 in the arguments).  The rest of the command is standard.

There is also a construct for use with host-identifier statements.
The “option” portion can be replaced with “v6relopt <number> <option-name> <option-data>.
Again the number indicates which relay to examine for the option.

The v6relay() statement is described in the dhcp-options man page while
the v6relopt is described in the dhcpd.conf man page.

NOTE WELL: the v6relay and v6relopt features were added in 4.3.0.  They aren’t
available in 4.1

Shawn Routhier



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20160720/8d5ac4a1/attachment.html>


More information about the dhcp-users mailing list