The pfSense Store

Author Topic: $50 for tftp-server-name DHCP option  (Read 32855 times)

0 Members and 1 Guest are viewing this topic.

Offline cayblood

  • Newbie
  • *
  • Posts: 2
    • View Profile
$50 for tftp-server-name DHCP option
« on: May 09, 2006, 12:41:03 pm »
We are setting up a remote office with a router running pfsense beta 3.  One important feature that we are currently using in our ipcop routers is the ability to set the tftp-server-name option in DHCP so that our IP phones automatically provision themselves by downloading an XML file from the tftp server that is in the DHCP offer.  This is pretty important to us because it makes it a lot easier to reprovision phones in offices that don't have any technical people.   Since we noticed that some configuration settings can be set manually in the pfsense XML configuration (such as next-server), we figured it would not be too hard to add this option as well.  I am posting a $50 bounty for this feature, since we are only going to be here for a few days and don't have time to develop it ourselves.

Please send solutions to carl at youngbloods dot org.  I will paypal the bounty to the first successful implementor.

Thanks,
Carl

Offline billm

  • Administrator
  • Hero Member
  • *****
  • Posts: 731
    • View Profile
    • UCSecurity - Technology discovery and ramblings
Re: $50 for tftp-server-name DHCP option
« Reply #1 on: May 09, 2006, 01:09:40 pm »
Sent private email on this (not that this should discourage anyone else ;-P)

--Bill
pfSense core developer
blog - http://www.ucsecurity.com/
twitter - billmarquette

Offline robbyt

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: $50 for tftp-server-name DHCP option
« Reply #2 on: May 09, 2006, 03:55:59 pm »
how about a more generic dhcp option#->value field?

Offline sullrich

  • Hero Member
  • *****
  • Posts: 5110
    • View Profile
    • pfSense
Re: $50 for tftp-server-name DHCP option
« Reply #3 on: May 09, 2006, 04:09:08 pm »
how about a more generic dhcp option#->value field?

No thanks.  It won't be used very often and we are not going to start cluttering the interface with this stuff for 1% usage.

Offline billm

  • Administrator
  • Hero Member
  • *****
  • Posts: 731
    • View Profile
    • UCSecurity - Technology discovery and ramblings
Re: $50 for tftp-server-name DHCP option
« Reply #4 on: May 09, 2006, 07:07:35 pm »
how about a more generic dhcp option#->value field?

No thanks.  It won't be used very often and we are not going to start cluttering the interface with this stuff for 1% usage.

As it is, this will likely only go in as a hidden config.xml option anyway.  I'll consider making it an array value that allows arbitrary dhcp options.  Maybe some day we'll figure out a compromise between the advanced features and the normal features that won't require editing config.xml - for now, that's the only real option.  Needless to say, this isn't going in 1.0 regardless of how it's implemented.

--Bill
pfSense core developer
blog - http://www.ucsecurity.com/
twitter - billmarquette

Offline robbyt

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: $50 for tftp-server-name DHCP option
« Reply #5 on: May 10, 2006, 01:13:30 pm »
how about a more generic dhcp option#->value field?

No thanks.  It won't be used very often and we are not going to start cluttering the interface with this stuff for 1% usage.

i can understand, and in someways agree with you. But you should perhaps re-examine the this. For example, at my office- i run an asterisk server with about 60-70 polycom phones. The latest polycom firmware lets you specify the sip server as a dhcp option. (i think it's like option# 165 or something like that)  You can push out all sorts of other wonderful and usefull stuff from dhcp: static routes, wins, ntp, and so on...

I can understand not having this ability due to complexity of implimentation, but this seems like a fairly trivial thing (other then interface bloat)

(attached is a screenshot from ipcop's dhcp server options)



Offline cayblood

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: $50 for tftp-server-name DHCP option
« Reply #6 on: May 10, 2006, 03:47:39 pm »
This bounty has been claimed by Daniel S. Haischt, who sent us some patched files, from which we were able to create a modification with a more minimal impact.

To add this feature, mount the filesystem in a writeable mode (if not already) with:

Code: [Select]
mount -w /

and then add the following code to /etc/inc/services.inc, starting at line 238:

Code: [Select]
if ($dhcpifconf['tftp-server-name'])
    $dhcpdconf .= " option tftp-server-name \"{#dhcpifconf['tftp-server-name']}\";\n";

Then just change your config.xml and add

Code: [Select]
<tftp-server-name>X.X.X.X</tftp-server-name>

under pfsense/dhcpd/lan. That should do it.

I agree with robbyt that adding the ability to set DHCP options is a common thing that is not supporting a 5% minority but actually would be used by a lot of people, and the changes to the interface would be minimal.

Best wishes,
Carl
« Last Edit: May 10, 2006, 03:50:57 pm by cayblood »

Offline sullrich

  • Hero Member
  • *****
  • Posts: 5110
    • View Profile
    • pfSense
Re: $50 for tftp-server-name DHCP option
« Reply #7 on: May 10, 2006, 04:04:25 pm »
This has been commited to -HEAD.

Thanks!

Offline DanielSHaischt

  • Full Member
  • ***
  • Posts: 131
  • [REVOLUTIONARY AND GEEKPRIMAS]
    • View Profile
Re: $50 for tftp-server-name DHCP option
« Reply #8 on: May 10, 2006, 04:17:33 pm »
If you want I can post the GUI related mods that I did to services_dhcp.php as well.

Regards
Daniel S. Haischt
Mit freundlichen Gruessen / With kind regards
DAn.I.El S. Haischt

Offline billm

  • Administrator
  • Hero Member
  • *****
  • Posts: 731
    • View Profile
    • UCSecurity - Technology discovery and ramblings
Re: $50 for tftp-server-name DHCP option
« Reply #9 on: May 10, 2006, 04:20:01 pm »
This bounty has been claimed by Daniel S. Haischt, who sent us some patched files, from which we were able to create a modification with a more minimal impact.

To add this feature, mount the filesystem in a writeable mode (if not already) with:

Code: [Select]
mount -w /

and then add the following code to /etc/inc/services.inc, starting at line 238:

Code: [Select]
if ($dhcpifconf['tftp-server-name'])
    $dhcpdconf .= " option tftp-server-name \"{#dhcpifconf['tftp-server-name']}\";\n";

Then just change your config.xml and add

Code: [Select]
<tftp-server-name>X.X.X.X</tftp-server-name>

under pfsense/dhcpd/lan. That should do it.

I agree with robbyt that adding the ability to set DHCP options is a common thing that is not supporting a 5% minority but actually would be used by a lot of people, and the changes to the interface would be minimal.

Best wishes,
Carl

fwiw, the better patch would have been something along the lines of:

Code: [Select]
foreach($dhcpifconf['options'] as $optname => $dhcpopt) {
$dhcpdconf .= " option {$optname} \"{$dhcpopt}\";\n";
}
and then added
Code: [Select]
<options>
<tftp-server-name>foobar</tftp-server-name>
</options>
to config.xml in the same place.  If someone creates a diff (that has been tested) with the above code concept, I'll commit it to HEAD (and only HEAD).

--Bill
pfSense core developer
blog - http://www.ucsecurity.com/
twitter - billmarquette

Offline billm

  • Administrator
  • Hero Member
  • *****
  • Posts: 731
    • View Profile
    • UCSecurity - Technology discovery and ramblings
Re: $50 for tftp-server-name DHCP option
« Reply #10 on: May 10, 2006, 04:20:49 pm »
or nm...the previous code was commited.  thus ends my interest in this. :)

--Bill
pfSense core developer
blog - http://www.ucsecurity.com/
twitter - billmarquette

Offline keefe007

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: $50 for tftp-server-name DHCP option
« Reply #11 on: June 12, 2006, 05:43:33 pm »
Is this going to be in the next GUI too?

Offline hoba

  • Administrator
  • Hero Member
  • *****
  • Posts: 5837
  • What was the problem to this solution again?
    • View Profile
    • pfSense
Re: $50 for tftp-server-name DHCP option
« Reply #12 on: June 12, 2006, 05:55:03 pm »
how about a more generic dhcp option#->value field?

No thanks.  It won't be used very often and we are not going to start cluttering the interface with this stuff for 1% usage.

With this said it most probably will remain a hidden xml option.

Offline keefe007

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: $50 for tftp-server-name DHCP option
« Reply #13 on: June 12, 2006, 06:27:09 pm »
I think many many people would use a feature such as this.  IP phones are becoming more and more popular and the easiest way to configure a network of them is with the tftp DHCP option.  I know this option would be used more than some of the other more specialized options that are already in pfsense.  I truely hope more people voice their need for this feature and you reconsider adding it to the gui.

Offline sullrich

  • Hero Member
  • *****
  • Posts: 5110
    • View Profile
    • pfSense
Re: $50 for tftp-server-name DHCP option
« Reply #14 on: June 12, 2006, 06:28:29 pm »
I think many many people would use a feature such as this.  IP phones are becoming more and more popular and the easiest way to configure a network of them is with the tftp DHCP option.  I know this option would be used more than some of the other more specialized options that are already in pfsense.  I truely hope more people voice their need for this feature and you reconsider adding it to the gui.

I'll meet you half way.  You do the GUI work and I'll commit.