Changes

Jump to navigation Jump to search
1,705 bytes added ,  14:45, 30 October 2008
Document custom-template method for customizing DHCPD lease times.
{{Needs review}}
You can customize the lease duration for the dhcp server ('''dhcpd''') in SME using these instructions.

== Create custom template fragments ==
The commands below will create custom template fragments for <tt>default-lease-time</tt> and <tt>max-lease-time</tt>, re-generate <tt>/etc/dhcpd.conf</tt>, and restart the '''dhcpd''' service in order to activate your changes.
mkdir -p /etc/e-smith/templates-custom/etc/dhcpd.conf
cd /etc/e-smith/templates-custom/etc/dhcpd.conf
echo " default-lease-time {21*86400};" > 25LeaseTimeDefault
echo " max-lease-time {21*86400};" > 25LeaseTimeMax
expand-template /etc/dhcpd.conf
sv restart dhcpd

=== Notes ===
* Replace "21" with the desired number of days.
* The spaces in front of "default-lease-time" and "max-lease-time" are important!
* SME default 'default-lease-time' is 1 day (86400 seconds).
* SME default 'max-lease-time' is 7 days (7*86400 = 604800 seconds).
* The SME <tt>expand-template</tt> command performs the calculation inside the braces and puts the results into the output file without braces.

== Verify your changes ==
Verify that your changes "stuck" by looking at the actual values in /etc/dhcpd.conf:
grep lease-time /etc/dhcpd.conf
The above sample, using {21*86400}, produces the following in /etc/dhcpd.conf:
default-lease-time 1814400;
max-lease-time 1814400;

== Un-Do these customizations ==
You can un-do these customizations with:
rm -f /etc/e-smith/templates-custom/etc/dhcpd.conf/25LeaseTimeDefault
rm -f /etc/e-smith/templates-custom/etc/dhcpd.conf/25LeaseTimeMax
expand-template /etc/dhcpd.conf
sv restart dhcpd

[[Category:Howto]]
[[Category:Administration]]

Navigation menu