Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: bloodshoteye on August 18, 2008, 02:58:03 PM

Title: DHCP - add custom entry
Post by: bloodshoteye on August 18, 2008, 02:58:03 PM
Hi all
We have an existing SME 7.3 sever providing dhcp, which we don't want to mess with.
We are setting up a FOG imaging server on the same LAN.
The FOG install has this option (bolding is mine):
Quote
[...]
Would you like to use the FOG server for dhcp service? [Y/n]
DHCP will not be setup but you must setup your
current DHCP server
to use FOG for pxe services.

On a Linux DHCP server you must set:
next-server
[...]

I had a look at /etc/e-smith/templates/etc/dhcpd.conf  - all the files in there are code, not settings, thus I'm unsure as to how to make the above entry in templates/custom.
Could someone prompt me on how to do that (exactly, please)?
Title: Re: DHCP - add custom entry
Post by: cactus on August 18, 2008, 07:30:41 PM
Hi all
We have an existing SME 7.3 sever providing dhcp, which we don't want to mess with.
We are setting up a FOG imaging server on the same LAN.
The FOG install has this option (bolding is mine):
I had a look at /etc/e-smith/templates/etc/dhcpd.conf  - all the files in there are code, not settings, thus I'm unsure as to how to make the above entry in templates/custom.
Could someone prompt me on how to do that (exactly, please)?
I don't know what your exact question is but my guess is you need a hostname to resolve to the IP of your FOG server. If so you can do that by reserving a IP number using the MAC address in the server-manager under the Hostnames and addresses panel.

You do not necessarily need FOG as you can also serve images from your SME Server using this contrib: http://wiki.contribs.org/Tftp_server
Title: Re: DHCP - add custom entry
Post by: bloodshoteye on August 19, 2008, 10:01:25 AM
cactus
Quote
I don't know what your exact question is but my guess is you need a hostname to resolve to the IP of your FOG server. If so you can do that by reserving a IP number using the MAC address in the server-manager under the Hostnames and addresses panel.
Of course, why didn't I think of that.

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?
Title: Re: DHCP - add custom entry
Post by: cactus on August 19, 2008, 12:00:34 PM
cactusOf course, why didn't I think of that.

Thanks for this pointerI'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?

I guess so there is a thinclient contrib to go with it.
Title: Re: DHCP - add custom entry
Post by: bloodshoteye on August 20, 2008, 09:41:47 AM
Quote
I guess so there is a thinclient contrib to go with it.
It seems these contribs are for booting thin clients.

FOG will download an image to a pxe client, making it a free opensource Ghost replacement:
http://www.fogproject.org/wiki/index.php?title=FOGUserGuide#Background_on_FOG
I'm not punting FOG here, just looking for a bit of help in sorting out our DHCP environment.

We wish to keep the DHCP service as currently supplied by our SME server, so have disabled DHCP on the FOG server.
All I'm asking, please, is where (in templates-custom) a more experienced SME admin would place the following DHCP statement:
Quote
Code: [Select]
if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
   next-server x.x.x.x;
   filename "pxelinux.0";
 };
Simply adding a host entry to SME's host panel is insufficient, I believe, although I've done that.
The FOG wiki indicates the above addition, but they aren't aware of SME's custom templating, so cannot assist me any further.
Title: Re: DHCP - add custom entry
Post by: cactus on August 20, 2008, 10:32:08 AM
The FOG wiki indicates the above addition, but they aren't aware of SME's custom templating, so cannot assist me any further.
Does the FOG wiki give you any pointers as to which configuration file to edit? Those templates together build the normal configuration files...
Title: Re: DHCP - add custom entry
Post by: bloodshoteye on August 20, 2008, 03:28:48 PM
cactus, thanks for responding.
Quote
Does the FOG wiki give you any pointers as to which configuration file to edit?
All they say is the following:
Quote
Existing DHCP server
You must add the following lines to your existing DHCP server
I've hunted through the forum - there is no specific mention, but I would think they refer to the dhcpd.conf file? Of course all threads relate to "standard" Linux.
Title: Re: DHCP - add custom entry
Post by: Confucius on August 20, 2008, 03:54:59 PM
From what I can make of the story is that the choice NO has the effect that FOG suggests it's running on a seperate server and therefore needs the line "next-server".
Any PXE request will be re-routed to the IP-address used with "next-server".
When you install FOG on the same server where you have the DHCP-service running you don't need to use "next-server".
The TFTP contrib is very suitable when you use FOG on the same server.

I hope this helps a little

Harro
Title: Re: DHCP - add custom entry
Post by: CharlieBrady on August 20, 2008, 03:59:17 PM
The FOG wiki indicates the above addition, but they aren't aware of SME's custom templating, so cannot assist me any further.

SME's templating is just an automated text editor. If you understand what you want to change in the output (the dhcpd.conf file) then working out what to replace or add to the templates shouldn't be hard.
Title: Re: DHCP - add custom entry
Post by: electroman00 on August 20, 2008, 07:11:38 PM


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

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

Restart the dhcp service

service dhcpd restart

If all is working cut it out and create a template file

pxeclient

 in

/etc/e-smith/templates-custom/etc/dhcpd.conf

dhcpd.conf is a folder in /etc/e-smith/templates-custom/etc/

create the folder & create the template file pxeclient in that folder.

restart the dhcp service.

service dhcpd restart

HTH





Title: Re: DHCP - add custom entry
Post by: electroman00 on August 20, 2008, 08:40:03 PM
.
Title: Re: DHCP - add custom entry
Post by: electroman00 on August 20, 2008, 09:20:08 PM
FOG interesting
Title: Re: DHCP - add custom entry
Post by: electroman00 on August 20, 2008, 09:20:52 PM
.
Title: Re: DHCP - add custom entry
Post by: CharlieBrady on August 20, 2008, 09:30:11 PM
.« Last Edit: Today at 03:12:34 PM by electroman00 »

electroman, please do not try to alter history by removing what you have written in the past.
Title: Re: DHCP - add custom entry
Post by: electroman00 on August 20, 2008, 10:37:03 PM
electroman, please do not try to alter history by removing what you have written in the past.

10-4
Title: Re: DHCP - add custom entry: Solved in another way
Post by: bloodshoteye 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.
Title: Re: DHCP - add custom entry
Post by: cactus 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.
Title: Re: DHCP - add custom entry
Post by: bloodshoteye 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
Title: Re: DHCP - add custom entry
Post by: cactus 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?
Title: Re: DHCP - add custom entry
Post by: bloodshoteye 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";
};
Title: Re: DHCP - add custom entry
Post by: electroman00 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
 
Title: Re: DHCP - add custom entry
Post by: electroman00 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 (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 (http://wiki.contribs.org/Thinclient_usage)

SideNote....

bug: http://bugs.contribs.org/show_bug.cgi?id=660 (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/DB_Variables_Configuration)
http://wiki.contribs.org/SME_Server:Documentation:Technical_Manual:Chapter3/de (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...
Title: Re: DHCP - add custom entry
Post by: Confucius 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
Title: Re: DHCP - add custom entry
Post by: bloodshoteye 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.
Title: Re: DHCP - add custom entry
Post by: Confucius 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.
Title: Re: DHCP - add custom entry
Post by: bloodshoteye 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.