Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: WILFRIED on January 05, 2011, 04:14:00 PM

Title: edit Dhcp.conf with next-server
Post by: WILFRIED on January 05, 2011, 04:14:00 PM
Hello, I'm installing a fog mirror server but I would like to stay using the sme 7 dhcp server. (www.fogproject.org) fog server is on other hardware than sme server.

In the fog installation manual I could find that I have to make a change in the dhcp.conf file wich is normally in /etc

*******************  fog manual ************************
Linux
If you would like to use an existing Linux based DHCPD server you will need to perform the following steps:

1.Edit your dhcpd.conf file (ie: vim /etc/dhcpd.conf)
2.In the global section or in a subnet declaration add next-server X.X.X.X; and filename "pxelinux.0"; where X.X.X.X is the IP of your FOG server.
3.Restart your dhcpd server (ie: service dhcpd restart)
******************* end fog manual *********************

But when I try to change the dhcp.conf I see that I cannot change it because it will be restored after restart etc... and that I have to read the developers manual.
In the developers manual I could find that I have to expand the files (if I don't misunderstood it).
 
I've edited the file etc/e-smith/events/bootstrap-console-save/templates2expand/etc/dhcp.conf with the two lines mentioned above
and I've created a dhcp.conf in /etc/e-smith/events/reboot/templates2expand/etc/dhcp.conf

When I rebooted the sme server and restarted the workstation I see that PXE is starting but I get an pxe error file not found.

I hope you can understand my English and my question and I hope to receive a solution

Best regards

Wilfried
Title: Re: edit Dhcp.conf with next-server
Post by: CharlieBrady on January 05, 2011, 09:49:28 PM
I've edited the file etc/e-smith/events/bootstrap-console-save/templates2expand/etc/dhcp.conf with the two lines mentioned above

That's not what you need to do. The *content* of that file is ignored. It's *existence* ensures that the file /etc/dhcp.conf is expanded during the bootstrap-console-save event.

You need to create a directory /etc/e-smith/templates-custom/etc/dhcp.conf and create one or more files in that directory.

Quote
and I've created a dhcp.conf in /etc/e-smith/events/reboot/templates2expand/etc/dhcp.conf

I think you should remove that file. I don't think you need to re-expand /etc/dhcp.conf during every reboot.

Please re-read thesection about custom templates in the  developers manual.
Title: Re: edit Dhcp.conf with next-server
Post by: bloodshoteye on December 10, 2012, 12:42:44 PM
@CharlieBrady

I realize this is an attempt at revving an old thread, but in case you are monitoring this, may I ask you a question? You said:
Quote
You need to create a directory /etc/e-smith/templates-custom/etc/dhcp.conf and create one or more files in that directory.

I have tried this without success. Do you mean a file like /etc/e-smith/templates-custom/etc/dhcp.conf/60StaticEntries
or
/etc/e-smith/templates-custom/etc/dhcp.conf  - where dhcp.conf contains the static entries?

I suspect I'm wrong on both counts. I've tried many combinations and searched the forums but alas - no joy.
This is for an up-to-date smeserver-8.0-x86_64 machine.

Cheers,
Title: Re: edit Dhcp.conf with next-server
Post by: janet on December 10, 2012, 01:22:00 PM
dishwasher

Quote
Do you mean a file like /etc/e-smith/templates-custom/etc/dhcp.conf/60StaticEntries

Yes, I'm sure he means that.

You should read this
http://wiki.contribs.org/Template_Tutorial

Ask again if anything is still not clear.
Title: Re: edit Dhcp.conf with next-server
Post by: bloodshoteye on December 11, 2012, 06:08:28 PM
@mary

Quote
Ask again if anything is still not clear.

If I may. Thanks for the reminder - I read the section that relates to DHCP. It said in part:
Quote
mkdir -p /etc/e-smith/templates-custom/etc/dhcpd.conf
echo "option domain-name-servers 4.2.2.1;" > /etc/e-smith/templates-custom/etc/dhcpd.conf/25DomainNameServers

I tried that and of course it works. However that is a single line entry. The tutorial has no multiline examples.Try as I might (I'm not a coder by any means), I could not make a multiline entry work, such as one would find in a lease file. I need to enter many static leases after changing the domain name. As you know, /etc/dhcpd.conf is replaced when one does that.

I need to add entries in this file: /etc/e-smith/templates-custom/etc/dhcpd.conf/60StaticEntries
I don't know how to achieve many of these:
Quote
host abc.domain.com {
    hardware ethernet aa:bb:cc:dd:ee:ff;
    fixed-address 10:0:1:25;
}

I also tried adding the above in various combinations before various closing braces as mentioned, but always get errors on expansion.

Any pointers, please?

Cheers
Title: Re: edit Dhcp.conf with next-server
Post by: CharlieBrady on December 11, 2012, 06:31:22 PM
Use '\{' and '\}' in place of '{' and '}'. You may get into trouble if you try to use 'echo' to create such a file - use 'nano' as an editor, so WYSIWYG.
Title: Re: edit Dhcp.conf with next-server
Post by: bloodshoteye on December 11, 2012, 07:47:28 PM
Use '\{' and '\}' in place of '{' and '}'. You may get into trouble if you try to use 'echo' to create such a file - use 'nano' as an editor, so WYSIWYG.

Thanks Charlie, your advice is spot on.

I use winscp at times, like this time. Created a template file with a list of entries, changed the domain name, rebooted the server and checked /etc/dhcpd.conf The static entries are there, Server Manger only shows the standard list of 6 entries like a brand new installation. This revelation (for me) makes such a difference in admin of this sort.

Solved in my case. No idea if the OP is sorted ...

Cheers,