Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

including additional configs outside of dhcpd.conf

Posted on 2004-04-17
9
Medium Priority
?
1,078 Views
Last Modified: 2013-11-18
Hi,

I have a dhcpd.conf file.  for organization purposes, I want to build files outside of dhcpd.conf that will store static ip - mac address mappings.  

I put the following in my dhcpd.conf

include "/etc/dhcpd.static";

but I get the following error upon dhcpd start.
/etc/dhcpd.conf line 16: expecting a declaration.

even with nothing in the dhcpd.static file, I get the error.  

Doesn't a config file like dhcpd.conf work the same way a config file for say /etc/apache/httpd.conf , as I have "include" referenced for virtual hosts (virtual.host) working just fine.

curious why I get this error.

thanks

-Air
0
Comment
Question by:Airgazm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10852712
No, you cannot just use the syntax and conventions of one configuration file and apply it to another file format. The dhcpd config file does not support any include mechanism
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10852724
If you need a component of the file that you can change, you could work with three files: A template file, your include file and the actual dhcpd.conf file, which would  be generated just before dhcpd gets started. You would then use either a macro processor (e.g. m4) or a Perl script that would merge your two files and write it out as the "real" dhcpd.conf file.

But, before you do that, you should take some time to find out if you really need this mechanism at all.
0
 

Author Comment

by:Airgazm
ID: 10854238
yes, I am thinking about writing a script just like you suggested.  thx

I am curious the "include" because I found this "include "/etc/dhcpd.master";  in the dhcpd.conf man file.

http://www.daemon-systems.org/man/dhcpd.conf.5.html


Thanks

-Air
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10854452
You are right, I just checked the man page on my system, it's listed. I've never used this feature (you probably can tell :-)

But, what I said is still true: You cannot assume something is supported, just because some other product supports it.

Which dhcpd are you using? Which distribution are you using?
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10854502
Is your dhcpd running in a chroot jail? If so, you need to put the file into the chroot directory. I just tried this with my system, and it did actually work. Check the command line dhcpd is started with:

ps -auxww | grep dhcpd

Do you see a -chroot parameter?
0
 

Author Comment

by:Airgazm
ID: 10854511
I wasn't sure if the syntax "include" was a shell command or part of the program.  Not sure how dhcpd works in that regard.  

I'm using debian, with ISC DHCP.

I guess i can just use one dhcpd config file but it would be nice to be able to place the other data in additional files.  There is also this other post I responded to on EE that is kinda what I'm trying to do here.

http://www.experts-exchange.com/Networking/Unix_Networking/Q_20888407.html
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10854692
As I said, it works for me. And I'm also using ISC DHCP, version 3.0.1rc13
Did you check if the daemon is running in a chroot jail?
0
 

Author Comment

by:Airgazm
ID: 10866179
I had version 2.2, I just upgraded to DHCP 3.0.1rc9
I built a script that processes the the dhcpd.conf and restarts the service.
I don't think its running in a chroot jail though, does it need to be for any reason.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 1000 total points
ID: 10867397
It's more secure. When somebody compromises the dhcp server, they only have access to the files in the chroot jail (at least that's the idea). If you are not using this feature, you can use the "real" path to the file and don't have to map it to the chroot root directory.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to dynamically set the form action using jQuery.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question