Skip to content

Commit

Permalink
dhcp: add options for static leases and custom domain names
Browse files Browse the repository at this point in the history
  • Loading branch information
Noki committed Aug 7, 2023
1 parent feb646a commit 47a8f99
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions roles/cfg_openwrt/templates/corerouter/config/dhcp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ config odhcpd 'odhcpd'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'

{% for dhcp_static_lease in dhcp_static_leases %}
config host
option name '{{ dhcp_static_lease['name'] }}'
option mac '{{ dhcp_static_lease['mac'] }}'
option ip '{{ dhcp_static_lease['ip'] }}'
{% if dhcp_static_lease['dns'] is defined %}
option dns '{{ dhcp_static_lease['dns'] }}'
{% endif %}

{% endfor %}
{% for dhcp_custom_domain_name in dhcp_custom_domain_names %}
config domain
option name '{{ dhcp_custom_domain_name['name'] }}'
option ip '{{ dhcp_custom_domain_name['ip'] }}'

{% endfor %}

0 comments on commit 47a8f99

Please sign in to comment.