Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dhcp_server] Add config_db monitor and customize options for dhcpservd #17051

Merged
merged 12 commits into from
Nov 16, 2023
18 changes: 18 additions & 0 deletions dockers/docker-dhcp-server/kea-dhcp4.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{%- set default_lease_time = 900 -%}
{
"Dhcp4": {
{%- if customized_options %}
"option-def": [
{%- for option_name, config in customized_options.items() %}
{
"name": "{{ option_name }}",
"code": {{ config["id"] }},
"type": "{{ config["type"] }}"
}{% if not loop.last %},{% endif %}
{%- endfor %}
],
{%- endif %}
"hooks-libraries": [
{
"library": "/usr/local/lib/kea/hooks/libdhcp_run_script.so",
Expand Down Expand Up @@ -44,6 +55,13 @@
{%- endfor%}
],
"option-data": [
{%- for option_name, config in subnet_info["customized_options"].items() %}
{
"name": "{{ option_name }}",
"data": "{{ config["value"] }}",
"always-send": {{ config["always_send"] }}
},
{%- endfor %}
{
"name": "routers",
"data": "{{ subnet_info["gateway"] if "gateway" in subnet_info else subnet_info["server_id"] }}"
Expand Down
2 changes: 1 addition & 1 deletion rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ INCLUDE_NAT = y
INCLUDE_DHCP_RELAY = y

# INCLUDE_DHCP_SERVER - build and install dhcp-server package
INCLUDE_DHCP_SERVER = n
INCLUDE_DHCP_SERVER = y

# INCLUDE_P4RT - build docker-p4rt for P4RT support
INCLUDE_P4RT = n
Expand Down
Loading