LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-31-2007, 07:04 PM   #1
mahengunawardena
LQ Newbie
 
Registered: Jul 2007
Location: Indiana, USA
Distribution: FC-4
Posts: 3

Rep: Reputation: 0
DHCP server config issues


Can some tell me why I get this error message?

/etc/dhcpd.conf line 0: expecting a parameter or declaration

dhcpd.conf file is (example copied off the web)


# Sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.org";

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}

appreciate your assistance.

Mahen
 
Old 08-01-2007, 02:04 AM   #2
risu
LQ Newbie
 
Registered: Feb 2005
Location: Helsinki, Finland
Posts: 19

Rep: Reputation: 2
It is something invisible. Could it be that the lines end with CR-LF, as in DOS, and dhcpd expects only LF, as in unix?

Try 'hexdump -c /etc/dhcpd.conf'. CR is \r and LF is \n.
 
Old 08-01-2007, 04:56 AM   #3
gani
Member
 
Registered: Jun 2004
Location: Metro Manila, Philippines
Distribution: Linuxmint, Slackware
Posts: 356

Rep: Reputation: 34
I used your configuration in my Slackware and it worked. The daemon only prompted me of adding a ddns-update-style in the global section. Here is my complete test dhcpd.conf which was originally derived from you.

Code:
# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 58.69.254.46, 192.168.1.2;
option domain-name "mydomain.com";

subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.10 192.168.1.100;
        range 192.168.1.150 192.168.1.200;
        }
Below is what it shows when dhcpd is started.

Code:
Internet Systems Consortium DHCP Server V3.0.3
Copyright 2004-2005 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 1 leases to leases file.
Listening on Socket/eth0/192.168.1/24
Sending on   Socket/eth0/192.168.1/24
And below is my transaction log report. I was able to obtain a lease and connect a windows client.

Code:
# tail -f /var/log/messages

Aug  1 17:31:56 webmaster dhcpd: DHCPREQUEST for 192.168.1.55 (192.168.1.100) from 00:04:76:72:2f:a2 (openbsd) via eth0
Aug  1 17:31:56 webmaster dhcpd: DHCPACK on 192.168.1.55 to 00:04:76:72:2f:a2 (openbsd) via eth0
Aug  1 17:32:19 webmaster dhcpd: DHCPRELEASE of 192.168.1.55 from 00:04:76:72:2f:a2 (openbsd) via eth0 (found)
Aug  1 17:32:27 webmaster dhcpd: DHCPDISCOVER from 00:04:76:72:2f:a2 via eth0
Aug  1 17:32:27 webmaster dhcpd: DHCPOFFER on 192.168.1.55 to 00:04:76:72:2f:a2 (openbsd) via eth0
Aug  1 17:32:28 webmaster dhcpd: DHCPREQUEST for 192.168.1.55 (192.168.1.100) from 00:04:76:72:2f:a2 (openbsd) via eth0
Aug  1 17:32:28 webmaster dhcpd: DHCPACK on 192.168.1.55 to 00:04:76:72:2f:a2 (openbsd) via eth0
---------
 
Old 08-01-2007, 05:47 AM   #4
sussane
LQ Newbie
 
Registered: Aug 2007
Posts: 19

Rep: Reputation: 0
I hope you have these two lines on your dhcpd.conf file on top
ddns-update-style interim;
ignore client-updates;
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Config DHCP server Ubuntu safapombo Linux - Networking 4 05-09-2007 09:20 AM
config dhcp server meysam39 Linux - Networking 1 08-07-2005 10:16 AM
how can config dhcp server? jsnch Solaris / OpenSolaris 8 06-19-2005 08:35 PM
DHCP Server Config riluve Linux - Networking 1 01-27-2005 08:53 AM
DHCP server config problem Q25 Linux - Networking 2 07-18-2003 07:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration