[Kea-users] Set domain-search option for dhcp4

Olivier Clavel olivier.clavel at gmail.com
Tue Feb 21 09:12:48 UTC 2017


Just tested a slightly more complicated example using data compression for
2 sub domains:

=> example.com ip4.example.com

1 - convert string to hex

e  x  a  m  p  l  e  .  c  o  m    i  p  4  .  e  x  a  m  p  l  e  .  c  o
 m
65 78 61 6d 70 6c 65 2e 63 6f 6d   69 70 34 2e 65 78 61 6d 70 6c 65 2e 63
6f 6d

2 - remove redundancy

e  x  a  m  p  l  e  .  c  o  m    i  p  4
65 78 61 6d 70 6c 65 2e 63 6f 6d   69 70 34

3- drop the dots, preprend each element with number of chars, terminate
first record with null

7) e  x  a  m  p  l  e  3)  c  o  m  null 3)  i  p  4
07 65 78 61 6d 70 6c 65 03  63 6f 6d 00   03  69 70 34

4- terminate second record (and next ones if any...) with a 2 byte pointer
to record ending offset in chain


+------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|offset| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |10 |11 |12 |13 |14 |15
|16 |17 |18 |
+------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

|data  | 7 |'e'|'x'|'a'|'m'|'p'|'l'|'e'| 3 |'c'|'o'|'m'|   | 3
|'i'|'p'|'4'|xC0|x00|
+------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

|hex   | 07| 65| 78| 61| 6d| 70| 6c| 65| 03| 63| 6f| 6d| 00| 03| 69|
70| 34| C0| 00|
+------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

       |           element 1           |  element 2    |   |  element
3    | ^   ^

       |                       domain 1                    |
domain 2 !   ! |

                                           Pointer
indicator-----------------!   !
                                                    Offset of
element------------!
3- copy result to config file
"option-data" : [{
    "name": "domain-search",
    "data": "076578616d706c6503636f6d0003697034C000",
    "csv-format": false
}]


On Tue, 21 Feb 2017 at 08:09 Olivier Clavel <olivier.clavel at gmail.com>
wrote:

In case someone comes other this thread with the same problem...

After reading the RFC (https://tools.ietf.org/search/rfc3397) and
struggling a bit, here is how to work around the problem until the future
enhancement is developed (see ticket below). Please read the rfc if you
need more than one domain. Example below for a single one.

1 - convert string to hex (conversion tool here:
http://www.swingnote.com/tools/texttohex.php)

e  x  a  m  p  l  e  .  c  o  m
65 78 61 6d 70 6c 65 2e 63 6f 6d

2 - drop the dots, prepend each element with number of chars and finish
with null
7) e  x  a  m  p  l  e  3) c  o  m  (null)
07 65 78 61 6d 70 6c 65 03 63 6f 6d 00

3- copy result to config file
"option-data" : [{
    "name": "domain-search",
    "data": "076578616d706c6503636f6d00",
    "csv-format": false
}]


On Mon, 20 Feb 2017 at 18:42 James Sumners <JamesSumners at clayton.edu> wrote:

I can tell you that it *does* have to be in encoded binary format —
http://kea.isc.org/ticket/5087




On February 20, 2017 at 12:32:33 PM, Olivier Clavel (
olivier.clavel at gmail.com) wrote:

Hello everyone.

Sorry to come here with a question that seems so basic. Unfortunately, I
can't find the way to set the domain-search option correctly sent back to
the dhcp4 client. This is what I've tried so far with the result.

1)
"option-data": [ {"name": "domain-search", "data": "clavel.loc"} ]

Kea refuses to start with following errors.

2017-02-18 15:25:53.899 ERROR [kea-dhcp4.dhcp4/3379] DHCP4_PARSER_FAIL
failed to create or run parser for configuration element subnet4: option
data does not match option definition (space: dhcp4, code: 119): unable to
cast clavel.loc to binary data type: attempt to decode a value not in
base16 char set (/etc/kea/kea-dhcp4.conf:337:51)
2017-02-18 15:25:53.899 ERROR [kea-dhcp4.dhcp4/3379] DHCP4_CONFIG_LOAD_FAIL
configuration error using file: /etc/kea/kea-dhcp4.conf, reason: option
data does not match option definition (space: dhcp4, code: 119): unable to
cast clavel.loc to binary data type: attempt to decode a value not in
base16 char set (/etc/kea/kea-dhcp4.conf:337:51)
2017-02-18 15:25:53.900 ERROR [kea-dhcp4.dhcp4/3379] DHCP4_INIT_FAIL failed
to initialize Kea server: configuration error using file
'/etc/kea/kea-dhcp4.conf': option data does not match option definition
(space: dhcp4, code: 119): unable to cast clavel.loc to binary data type:
attempt to decode a value not in base16 char set
(/etc/kea/kea-dhcp4.conf:337:51)


2)
"option-data": [ {"name": "domain-search", "data": "636C6176656C2E6C6F63"} ]
"option-data": [ {"name": "domain-search", "data": "636C6176656C2E6C6F63"},
"csv-format": false ]

In both cases, the server starts correctly but then the following error
appears in dhcp client:

Invalid domain list.
suspect value in domain_search option - discarded


Is there some part of the doc I missed ? Thanks in advance for your answers.

_______________________________________________
Kea-users mailing list
Kea-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20170221/9c824d75/attachment-0001.html>


More information about the Kea-users mailing list