Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: henrikmc on October 30, 2008, 12:53:50 PM
-
I was happy with the dhcp contrib for sme 6.0.1.
Now in 7.3, I cant seem to find anything like it. I need the adjust the dhcp lease time as its way to short in default settings.
How to accomplish this? :shock:
-
Try this.
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
* 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 expand-template command performs the calculation inside the braces and puts the results into the output file without braces.
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;
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
(Note: added to wiki at http://wiki.contribs.org/Dhcpd_lease_time )
-
I need the adjust the dhcp lease time as its way to short in default settings.
Really? What problem do you have with the default setting?
-
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
naturally, I could always put (for example) 3600 and 7200.. I mean, time has to be expressed in seconds, no matter what I put.. right?
Ciao
Stefano
P.S. what about creating DB entries for leasetime and leasetimemax?
-
naturally, I could always put (for example) 3600 and 7200
Yes.
You could also do more math:
* {60*60} (60 seconds times 60 minutes ==> 1 hr)
* {60*60*2} (2 hrs)
* {60*60*24} (24 hrs, 60 minutes, 60 seconds ==> 1 day
* {60*60*24*7*3} (1 day times 7 times 3 ==> 3 weeks)
-
P.S. what about creating DB entries for leasetime and leasetimemax?
It would be possible, but it's also very easy for someone who wants to tweak this to supply a custom template. Nobody has yet suggested a reason why the default creates a problem. Each client exchanging a few packets with the server per day is hardly excessive traffic.
[Check the bug tracker for the many other things that developers might better spend their time on.]
-
It would be possible, but it's also very easy for someone who wants to tweak this to supply a custom template. Nobody has yet suggested a reason why the default creates a problem. Each client exchanging a few packets with the server per day is hardly excessive traffic.
[Check the bug tracker for the many other things that developers might better spend their time on.]
Yes, its easy but compared to other functions that sme provides in server-manager, its not.
For me, I would have liked the following:
DHCP control panel:
- Adjust lease times, one day is short in my networks. 3-7 days, and in some nets with servers I would prefere 30 days... Makes them static while keeping it easy with DHCP.
- See active leases with possiblilty to release them
- Set reservations for certain MAC's (not sure if dhcp server in sme dist is capable)
- Set / adjust scope options
DNS:
- Dynamic DNS, all my clients a-records will have to be created manually as it is now. Let DHCP server update DNS?
- Create records panel, mx, A-record etc.
- Flush dns cache
Just my needs, if nobody else would need it then there is no need to spend time building this. But I guess thats why we have contribs, they usually emerge from one admin needs dont they?
Thank you for the help, much appreciated. And I must say that sme 7.3 works well. Its a pleassure to work with. On one highly customised 6.0.1, I used the upgradedisk method, and almost everything worked after the restore. (except databases and e-mail aliases)
Oh, just one thing - what about a language selection possibility in the server-manager?
H
-
Yes, its easy but compared to other functions that sme provides in server-manager, its not.
For me, I would have liked the following:
DHCP control panel:
- Adjust lease times, one day is short in my networks. 3-7 days, and in some nets with servers I would prefere 30 days... Makes them static while keeping it easy with DHCP.
- See active leases with possiblilty to release them
- Set reservations for certain MAC's (not sure if dhcp server in sme dist is capable)
- Set / adjust scope options
DNS:
- Dynamic DNS, all my clients a-records will have to be created manually as it is now. Let DHCP server update DNS?
- Create records panel, mx, A-record etc.
- Flush dns cache
Just my needs, if nobody else would need it then there is no need to spend time building this. But I guess thats why we have contribs, they usually emerge from one admin needs dont they?
Thank you for the help, much appreciated. And I must say that sme 7.3 works well. Its a pleassure to work with. On one highly customised 6.0.1, I used the upgradedisk method, and almost everything worked after the restore. (except databases and e-mail aliases)
Oh, just one thing - what about a language selection possibility in the server-manager?
H
WOW, Good Stuff!!!
Sounds like you'll be busy writing some code for the next few days. Wrap all that up in a couple of RPM's and post them to the bug tracker for testing and consideration into the base OS when you're done.
-
- Adjust lease times, ...
Nobody has yet suggested why the default causes any problem.
- See active leases with possiblilty to release them
The DHCP protocol doesn't allow for leases to be revoked once granted.
Oh, just one thing - what about a language selection possibility in the server-manager?
That's done via browser settings.
-
- Set reservations for certain MAC's (not sure if dhcp server in sme dist is capable)
AFAIK this can be done through the hostname panel, you can serve an IP address based on MAC address there.
-
I use the DHCP manager from the SME 6 contrib. Had to change a file though to make it display the correct machine names and MAC addresses, and it didn't quite display the successful change page properly, but it did actually do the changes. I emailed the file thru to the contrib author at the time (forget who now) to perhaps update, but haven't seen anything yet.
It let you remove leases from the dhcp lease file, change the default lease time as you want.
As already posted, you can reserve IP addresses - I use it for reserving network printers and wireless access points etc, then just set them all for DHCP and away you go. You can then ping a sensible name too, like "photocopier" instead of having to remember IP addresses etc.
As for DNS updates, SME supports the free DNS.org and other services if you want to find your box on the internet. Set it up via the console.
-
I emailed the file thru to the contrib author at the time (forget who now) to perhaps update, but haven't seen anything yet.
Please use the bug tracker. Thanks.