Koozali.org: home of the SME Server

DHCP - add custom entry

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: DHCP - add custom entry: Solved in another way
« Reply #15 on: August 21, 2008, 12:47:19 AM »
electroman

Quote
Paste that to /etc/dhcpd.conf at the end of the file, etc, etc

I'm reading this on the run - I became way too busy to apply your suggestion tonight. Will give it a wag tomorrow.
« Last Edit: August 22, 2008, 01:53:30 PM by ardugh »
SME Server is a fantastic product - thank you!

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: DHCP - add custom entry
« Reply #16 on: August 21, 2008, 09:35:31 AM »
electroman

I'm reading this on the run - I became way too busy to apply your suggestion tonight. Will give it a wag tomorrow.
No don't do that as the file is templates and you additions will be disappear on modification/re-expansion of the templates, which are triggered by many events.

Instead find the section on the template engine in the SME Server Developers Guide and apply your modifications according to the instructions in there.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: DHCP - add custom entry
« Reply #17 on: August 21, 2008, 10:26:35 AM »
electroman00, this si what happens:

Adding that code to /etc/dhcpd.conf and restarting the service produces no errors on the sme box.

Adding a custom template produces the following error on expansion:
Quote
# expand-template /etc/dhcpd.conf
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Unquoted string "x" may clash with future reserved word at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2.
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Unquoted string "x" may clash with future reserved word at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2.
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Unquoted string "x" may clash with future reserved word at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2.
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Unquoted string "filename" may clash with future reserved word at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 3.
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: String found where operator expected at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 3, near "filename "pxelinux.0""
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient:   (Do you need to predeclare filename?)
ERROR in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Program fragment delivered error <<syntax error at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2, near "x.">> at template line 1
ERROR: Template processing failed for //etc/dhcpd.conf: 6 fragments generated warnings, 1 fragment generated errors
 at /sbin/e-smith/expand-template line 45

Perhaps I'm misunderstanding something.

EDIT: It struck me that next-server should point to a real IP address, so I did that and received the following (slightly different) error. Apologies for the lengthy post:
Quote
expand-template /etc/dhcpd.conf
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Number found where operator expected at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2, near "server 10.0.1.247"
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient:   (Do you need to predeclare server?)
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Unquoted string "filename" may clash with future reserved word at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 3.
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: String found where operator expected at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 3, near "filename "pxelinux.0""
WARNING in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient:   (Do you need to predeclare filename?)
ERROR in /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient: Program fragment delivered error <<syntax error at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2, near "server 10.0.1.247">> at template line 1
ERROR: Template processing failed for //etc/dhcpd.conf: 5 fragments generated warnings, 1 fragment generated errors
 at /sbin/e-smith/expand-template line 45
« Last Edit: August 21, 2008, 10:49:08 AM by ardugh »
SME Server is a fantastic product - thank you!

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: DHCP - add custom entry
« Reply #18 on: August 21, 2008, 11:51:18 AM »
The errors are most likely in your custom template fragment, could you paste it's content here please so we can review it?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: DHCP - add custom entry
« Reply #19 on: August 21, 2008, 12:01:03 PM »
Here it is, cactus. I've renamed the fragment pxeclient, 25pxeclient and 65pxeclient, but that has no bearing on the error.

Quote
Code: [Select]
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
next-server 10.0.1.247;
filename "pxelinux.0";
};
SME Server is a fantastic product - thank you!

Offline electroman00

  • *****
  • 491
  • +0/-0
Re: DHCP - add custom entry
« Reply #20 on: August 21, 2008, 04:43:36 PM »
Try

Code: [Select]
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
   next-server "10.0.1.247";
   filename "pxelinux.0";
 };

Looks like the code is missing the quotes around the IP.

Unquoted string "x" may clash with future reserved word at /etc/e-smith/templates-custom//etc/dhcpd.conf/25pxeclient line 2.

Unquoted string line 2

Suggest you delete the template and paste the code into /etc/dhcpd.conf for testing then....

service dhcpd restart

Then if the code borks the server you simply reboot.
If you put the code into a template and it borks then a reboot will not remove the template and the server is still borked.
Then you will have to find a way to delete the template and reboot. PITA

If this code borks the dhcp server then you will need to remediate via the console.

Once you have it working then create the template and your done.

Could you post the contents of /etc/dhcpd.conf before you remove the template so we can see what it was doing.

Not sure if your aware, this code basically routes pxeclient requests to the fog server.

Also do you have the Fog server setup?

For testing I would think that a dynamic IP will work, however you should consider a static IP once all is well.

Keep in mind SME static assignments must be made outside it's dynamic pool (range).

HTH
 

Offline electroman00

  • *****
  • 491
  • +0/-0
Re: DHCP - add custom entry
« Reply #21 on: August 21, 2008, 08:34:47 PM »
ardugh

Some investigation reveals this, do believe cactus made reference to it in the beginning.
So he be the one to thank...
Thanks cactus....may the force be with you.

http://wiki.contribs.org/Thinclient

So Delete  all your custom templates because their not needed nor will they work.
Suggest a reboot to obtain a clean slate.

Load that up and you should be good to go....

Also find

Quote
Note : the default Executable is PXELinux (pxelinux.0), but if you use something else (eg. a <image>.nbi.zpxe file), just enter that in the Executable field.

Here http://wiki.contribs.org/Thinclient_usage

SideNote....

bug: http://bugs.contribs.org/show_bug.cgi?id=660

Also to anyone listening, wiki bootp needs the allow option added to all the bootp doc's as
per the bug fix.
wiki search    bootp

http://wiki.contribs.org/DB_Variables_Configuration
http://wiki.contribs.org/SME_Server:Documentation:Technical_Manual:Chapter3/de

And it probably wouldn't hurt to put a link to the wiki Thinclient below those.

I have verified bootp allow to work here and the bug is marked resolved at this point in time.

Have a good day...

Offline Confucius

  • *****
  • 235
  • +0/-0
Re: DHCP - add custom entry
« Reply #22 on: August 21, 2008, 08:49:05 PM »
SIGH

I already felt I was talking to a wall ... but at least people start seeing the light.

Now make sure that you read before act.
As I always suggest : watch, think, do (in that order)

good luck

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: DHCP - add custom entry
« Reply #23 on: August 21, 2008, 11:15:31 PM »
Thanks to all who have contributed to this thread.

I've visited the links above (which I read) before my very 1st post (I did not know then about the bug thread). Please note one of my first responses (3rd post from the top):
Quote
Thanks for this pointer
Quote
You do not necessarily need FOG as you can also serve images from your SME Server using this contrive: http://wiki.contribs.org/Tftp_server
I'm looking through the threads on this - very interesting. This contrib promotes a one stop shop, which can be ideal.
I've not yet read how to provide a xp image to a pxe client, though. I assume this is feasible?

My attempts to mail Trevor Batley failed. I wanted to ask him: "Serving" an image via his contrib means
a) booting and running a workstation (which may not even have a hard drive) over the network,
or
b) sending a complete image to a fat client
or both.

The Thinclient usage page doesn't explicitly say an image (windows or *nux) can be multicasted to one or more pxeclients, I decided the FOG option was the way to go, however it overwrites several config files on installation - unsuitable on sme (surely).

The following Wikipedia definition of "thinclient" is how I understand it:
Quote
A thin client (sometimes also called a lean or slim client) is a client computer or client software in client-server architecture networks which depends primarily on the central server for processing activities, and mainly focuses on conveying input and output between the user and the remote server. In contrast, a thick or fat client does as much processing as possible and passes only data for communications and storage to the server.

I wrongly assumed my original question was clear enough:
We need to multicast an image (initially) xp-pro, to many pc's as one might do using proprietary Ghost software from Symantec.
SME Server is a fantastic product - thank you!

Offline Confucius

  • *****
  • 235
  • +0/-0
Re: DHCP - add custom entry
« Reply #24 on: August 21, 2008, 11:25:50 PM »
TFTP-Server, also known as BOOTP (old times) is capable of starting a client. Fat or Thin doesn't really matter. The proces in the "filename" results in actions choosen by the maintainer.

Since you like to use FOG you need to be able to start a client with TFTP. The existing contrib is very suitable for this job. Then you only have to add FOG on top to your server and don't have to worry about the TFTP/DHCP options since that can be managed from the server-manager with this contrib.

I hope this helps you understand the situation somewhat better.

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: DHCP - add custom entry
« Reply #25 on: August 22, 2008, 01:52:41 PM »
Ok, I installed thinclient & pointed it to the FOG box for tftp.
After completing preliminaries to the client-image-to-be, rebooted, changed BIOS to pxeboot.
Currently busy uploading the first image to FOG  :grin:
This means that sme does as you-all said - enables pxeboot on the LAN and selects self or another box as tftp server.
For our purpose, preparing a series of images to be pushed to clients as required, the combo of SME + FOG appears (for the time being) to be the FOSS solution.

Thanks for the help + pointers.
SME Server is a fantastic product - thank you!