if pub has more than 50% active leases, limit max-lifetime

This commit is contained in:
webzwo0i 2016-12-15 22:41:03 +01:00
parent a328d67753
commit 0d551a082d
2 changed files with 5 additions and 0 deletions

View File

@ -16,6 +16,7 @@ dhcp:
end: 172.20.77.254
time: 30
max-time: 3600
lower-max-time: 50
opts:
host-opts:
routers: pub-gw.pub

View File

@ -8,6 +8,10 @@ subnet {{ subnet.split('/')[0] }} netmask {{ netmasks[subnet.split('/')[1]] }} {
authoritative;
default-lease-time {{ conf['time'] }};
max-lease-time {{ conf['max-time'] }};
{%- if iface in ['pub'] %}
min-lease-time {{ conf['time'] }};
adaptive-lease-time-threshold {{ conf['lower-max-time'] }};
{%- endif %}
range {{ conf['start'] }} {{ conf['end'] }};
{%- for name, value in (conf.get('opts') or {}).items() %}
option {{ name }} {{ value }};