mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +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:
@@ -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
|
||||
}
|
||||
}
|
||||
}],
|
||||
...
|
||||
|
Reference in New Issue
Block a user