ansible/roles/dhcpd/templates/dhcpd.conf.j2

46 lines
1.4 KiB
Plaintext
Raw Normal View History

# {{ ansible_managed }}
2017-03-27 17:42:48 +02:00
# option definitions common to all supported networks...
option domain-name "{{ site_domain }}";
2020-11-05 18:54:26 +01:00
option domain-name-servers {{ nextnode4 }}, {{ name_server }};
2017-03-27 17:42:48 +02:00
local-address {{ batman_ipv4 | ipaddr('address') }};
2017-03-27 17:42:48 +02:00
default-lease-time 3600;
max-lease-time 14400;
# Use this to enble / disable dynamic dns updates globally.
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# Freifunk Regensburg
subnet {{ batman_ipv4 | ipaddr('network') }} netmask {{ batman_ipv4 | ipaddr('netmask') }} {
option routers {{ batman_ipv4 | ipaddr('address') }};
2018-07-21 17:18:18 +02:00
option interface-mtu {{ (mtu | int) - 32 }};
2017-03-27 17:42:48 +02:00
pool {
range {{ dhcpd_first }} {{ dhcpd_last }} ;
2017-03-27 17:42:48 +02:00
}
2017-04-03 22:36:10 +02:00
# use static arp entries to reduce broadcast
on commit {
set clip = binary-to-ascii(10, 8, ".", leased-address);
set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
2017-04-05 22:01:37 +02:00
execute("/usr/sbin/arp", "-s", clip, clhw);
2017-04-03 22:36:10 +02:00
}
on release {
set clip = binary-to-ascii(10, 8, ".", leased-address);
2017-04-05 22:01:37 +02:00
execute("/usr/sbin/arp", "-d", clip);
2017-04-03 22:36:10 +02:00
}
on expiry {
set clip = binary-to-ascii(10, 8, ".", leased-address);
2017-04-05 22:01:37 +02:00
execute("/usr/sbin/arp", "-d", clip);
2017-04-03 22:36:10 +02:00
}
2017-03-27 17:42:48 +02:00
}