mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 05:27:55 +00:00
[#1989] Updated ARM
Changes to be committed: modified: doc/sphinx/arm/dhcp4-srv.rst modified: doc/sphinx/arm/hooks-ddns-tuning.rst
This commit is contained in:
parent
d2a50cdb4e
commit
b44a370086
@ -4029,6 +4029,13 @@ qualifying suffix is "example.com", and the default value is used for
|
||||
|
||||
``myhost-172-16-1-10.example.com.``
|
||||
|
||||
.. note::
|
||||
|
||||
When the client sends the host name option, ``kea-dhcp4`` never adds a dot to
|
||||
the returned host name. It will only end with a dot if the client sent it
|
||||
already qualified and ending with a dot. When the client sends the FQDN option,
|
||||
the FQDN returned in the response will always end with a dot.
|
||||
|
||||
.. _dhcp4-host-name-sanitization:
|
||||
|
||||
Sanitizing Client Host Name and FQDN Names
|
||||
|
@ -59,6 +59,23 @@ expression is shown below:
|
||||
...
|
||||
}
|
||||
|
||||
The default behavior of :iscman:`kea-dhcp4` is to prefer the FQDN option (code 81) over the
|
||||
host name option (code 12) when a client sends both. The following example shows
|
||||
the ``hostname-expr`` one would use to reverse this rule:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
{
|
||||
"hooks-libraries": [
|
||||
{
|
||||
"library": "/usr/local/lib/libdhcp_ddns_tuning.so",
|
||||
"parameters": {
|
||||
"hostname-expr" : "ifelse(option[12].exists, option[host-name].text, option[81].text)"
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
It is also possible to define this parameter in a subnet, using the user-context mechanism.
|
||||
If defined at the subnet level, the expression applies to a specific subnet only. If the
|
||||
subnet expression is defined as empty, ``""``, it suppresses (or disables) the use of a
|
||||
@ -73,19 +90,13 @@ global expression for that subnet. An example subnet expression is shown below:
|
||||
"pool": "192.0.2.10 - 192.0.2.20"
|
||||
} ],
|
||||
|
||||
// This is a subnet-specific user context.
|
||||
"user-context": {
|
||||
"ddns-tuning": {
|
||||
"hostname-expr": "'guest-'+int8totext(substring(pkt4.yiaddr, 0,1))+'-' \
|
||||
+int8totext(substring(pkt4.yiaddr, 1,2))+'-' \
|
||||
+int8totext(substring(pkt4.yiaddr, 2,3))+'-' \
|
||||
+int8totext(substring(pkt4.yiaddr, 3,4))"
|
||||
},
|
||||
"last-modified": "2017-09-04 13:32",
|
||||
"description": "you can put anything you like here",
|
||||
"phones": [ "x1234", "x2345" ],
|
||||
"devices-registered": 42,
|
||||
"billing": false
|
||||
}
|
||||
}
|
||||
}],
|
||||
...
|
||||
|
Loading…
x
Reference in New Issue
Block a user