Koozali.org: home of the SME Server

dhcpd

Offline onyunn

  • 2
  • +0/-0
dhcpd
« on: August 27, 2007, 03:07:46 PM »
I'm a new user, and while relatively adept at editing .conf files in Linux, I'm having a hard time figuring out the db edit in SME.

I need to edit the dhcpd.conf file to include other information to be passed to my network clients.

1.  NTP server for syncing time (pool.ntp.org)
2.  GMT Offset (in my case -18000)
3.  DNS Servers
4.  Option 66 (IP address of TFTP server used for provisioning my VoIP phones)

Please help, any would be greatly appreciated.

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: dhcpd
« Reply #1 on: August 28, 2007, 03:19:28 AM »
If you're using windows, there's a logon contrib that will set the time upon logging into the domain, for provisioning voip there's SAIL and SME itself is a DNS server.

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Re: dhcpd
« Reply #2 on: August 28, 2007, 05:49:43 AM »
I need to edit the dhcpd.conf file to include other information to be passed to my network clients.

1.  NTP server for syncing time (pool.ntp.org)
2.  GMT Offset (in my case -18000)
3.  DNS Servers
4.  Option 66 (IP address of TFTP server used for provisioning my VoIP phones)
There aren't any standard db items for these, but it's not too hard to add a template fragment. I have a contrib, tftp-server that does similar (ie. it sets next-server and filename options). Download it from my contribs area and look a the templates in /etc/e-smith/templates/etc/dhcpd.conf (mc will let you browse into .rpm's).

Create your own in /etc/e-smith/templates-custom/etc/dhcpd.conf, expand-template /etc/dhcpd.conf and then /etc/init.d/dhcpd restart.

Good Luck
Trevor B

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: dhcpd
« Reply #3 on: August 28, 2007, 10:41:01 PM »
Create your own in /etc/e-smith/templates-custom/etc/dhcpd.conf, expand-template /etc/dhcpd.conf and then /etc/init.d/dhcpd restart.

dhcpd should be restarted only via:

/etc/rc7.d/S*dhcpd restart

or

sv t /service/dhcpd

The command you've given probably won't work correctly.

Restarting dhcpd implicity causes the config file to be re-expanded, so expand-template isn't required.


Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: dhcpd
« Reply #4 on: August 28, 2007, 10:42:18 PM »
I need to edit the dhcpd.conf file to include other information to be passed to my network clients.

1.  NTP server for syncing time (pool.ntp.org)
2.  GMT Offset (in my case -18000)
3.  DNS Servers
...

You should tell your network clients to use the SME server for NTP and DNS.


Offline onyunn

  • 2
  • +0/-0
Re: dhcpd
« Reply #5 on: August 28, 2007, 10:54:09 PM »
The specific problem I am having is that previously I was using my router, a Fortigate, to handle internal DHCP, but that router does not give me the ability to specify dhcp options.  I'm trying to use SME as I need more granular control over dhcp.  We are implementing a VoIP phone system from Asterisk, using Polycom ip430 phones.  These phones usually get the NTP information from the Asterisk appliance if used as a gateway and it's dhcp server.  In an attempt and following a recommendation from Asterisk (Digium), we are trying to use a separate dhcp server.  We will also be using SME to provision network shares for our users.

The Polycom phones receive the dhcp information, and that information should include the method/server and gmt offset for syncing its time.  There is no way to manually enter the information into the phone, as by design the time is set via NTP, and determines that path via the dhcp information it receives.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: dhcpd
« Reply #6 on: August 28, 2007, 11:30:44 PM »
Hi there,

I'm pretty sure that with the Polycoms you don't have to set ntp from dhcp, you can do it in the provisioning set...  Here's an example from a contributor who is using Polycoms with SAIL...

Code: [Select]
tcpIpApp.sntp.resyncPeriod="14400"
tcpIpApp.sntp.address="192.168.0.1"
tcpIpApp.sntp.address.overrideDHCP="1"
tcpIpApp.sntp.gmtOffset="-25200"
tcpIpApp.sntp.gmtOffset.overrideDHCP="1"
tcpIpApp.sntp.daylightSavings.enable="0"

...and here is an example of how we set option 66 for our SIP provisioning subsystem in SAIL.  We do it in a template we created called /etc/e-smith/templates/etc/dhcpd.conf/25TFTPServerName.  The code fragment looks like this...

Code: [Select]
{
#----------------------------------------------------------------------
#
# Copyright (c) Selintra.com 2005
#
#----------------------------------------------------------------------
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
# Technical support for this program is available from Selintra Ltd
# Please visit our web site www.selintra.com/ for details.
#----------------------------------------------------------------------
package esmith;

use strict;
use Errno;
use esmith::config;
use esmith::util;
use esmith::db;

my %config;
tie %config, 'esmith::config', '/home/e-smith/db/configuration';

    my $systemname = db_get_type(\%config, 'SystemName')       || '';
    my $domainname = db_get_type(\%config, 'DomainName')       || '';

    $OUT .= "    option tftp-server-name     \"$systemname.$domainname\";\n";
}

You should be able to modify this on to suit your own needs.

Kind Regards

Selintra

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: dhcpd
« Reply #7 on: August 28, 2007, 11:44:41 PM »
The code fragment looks like this...

But it could look like this:

Code: [Select]
#----------------------------------------------------------------------
#
# Copyright (c) Selintra.com 2005
#
#----------------------------------------------------------------------
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
#----------------------------------------------------------------------
{
    $OUT .= "    option tftp-server-name     \"$SystemName.$DomainName\";\n";
}

Or even just:

Code: [Select]
{
    $OUT .= "    option tftp-server-name     \"$SystemName.$DomainName\";\n";
}

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: dhcpd
« Reply #8 on: August 29, 2007, 01:02:07 AM »
Cheers Charlie,

When I wrote this I didn't have a clue which variables were instantiated (and which weren't) in any particular template tree (outside of config, I'm not sure I do now).  Hence the "belt and braces" fetch.   

S

 



 


Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: dhcpd
« Reply #9 on: August 29, 2007, 01:12:43 AM »
When I wrote this I didn't have a clue which variables were instantiated (and which weren't) in any particular template tree (outside of config, I'm not sure I do now).

The Developers Guide should be complete and clear. If it's not, please report via the Bug Tracker.