LinuxQuestions.org
Review your favorite Linux distribution.
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 12-01-2009, 11:47 AM   #1
Peter_Karlsen
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: 0
dhcpd not giving deafult gateway and dns to clients


Hi

I have some problems getting my dhcp server to function properly.

My setup is as follows:
Fedora Core 11 running as a server/internet gateway.
I have two NICs. eth0 connected to the internet and eth1 connected to my local network.
Firewall is configured with shorewall. It appears to work OK.

dhcpd does not seem to work correctly. I would like dhcpd to hand out ip addresses, default gateway and dns servers to all clients who connect to my local network.

Right now it appears that it only hands out an ip address.

my dhcpd.conf is as follows:
# Local Network
ddns-update-style none;
authoritative;
option domain-name "example.org";
option domain-name-servers 194.239.134.83, 193.162.153.164;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.31;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
allow unknown-clients;
# HP LaserJet 1200N
host LaserJet1200 {
hardware ethernet 00:01:e6:90:9c:61;
fixed-address 192.168.1.50;
}
}

Can anyone help me?
I have read the documentation for dhcpd and dhcpd.conf, but I just can't figure out what is wrong.

Best regards

Peter
 
Old 12-01-2009, 11:58 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
If I remember correctly, you want to move (or copy) the option domain-name-servers 194.239.134.83, 193.162.153.164; line into the subnet {} section as well as having it in the global section. That, along with the routers option *should* allow the DNS information to get propagated to the client machine. You may also want/need to do this in the host{} entries, if you are having trouble there. (sorry, forgot the host{} is INSIDE the subnet{} so that should not be needed.

If this doesn't work for you, and nobody else has verified that this is correct (or not, and given better advice) I'll dig into my firewall/DNS machine and see what I put in my dhcpd.conf for you -- it worked fine for me, but I do remember way back when I set it up, something to this effect, and a little fiddling.

Keep us posted
Sasha

Last edited by GrapefruiTgirl; 12-01-2009 at 12:03 PM.
 
1 members found this post helpful.
Old 12-01-2009, 12:16 PM   #3
Peter_Karlsen
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
I tried copying the option domain-name-servers line into the subnet section and restarted dhcpd.

It doesn't seem to change anything. :-(

/Peter
 
Old 12-01-2009, 12:22 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
OK, later today (few hours) I will have a look at my dhcpd.conf file on my firewall machine if you haven't got this sorted by that time, and see what jumps out.

One thing I do recall, is that a Windows machine on my LAN here refused to accept DNS and routing information from my Linux machine until one of two things: change the dhcpcd client version on the Win machine, or downgrade the dhcpd version on the firewall machine. After that everything was peachy. Some versions of dhcpd servers + dhcpcd clients to not play well together, especially when the client is Windows. {{ just something to keep in mind, in case you have Win machine(s) on the LAN}}

Sasha
 
1 members found this post helpful.
Old 12-01-2009, 01:00 PM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
On my firewall machine, It's using isc-dhcpd version 3.1.2 and here's the stuff in my .conf file:

Code:
boot-unknown-clients false;
ddns-update-style none;
one-lease-per-client true;
ping-check false;
log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {
 # this is for eth0 connected desktop
 default-lease-time 3600;
 max-lease-time 7300;
 option routers 192.168.0.10;

 group {
  option domain-name-servers 192.168.0.10;
  use-host-decl-names true;
  host darkstarssi {
    option host-name "darkstarssi";
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address 192.168.0.30; }
       }
}

... and so on, more subnets below....
Each NIC has a SUBNET clause, containing a GROUP clause, which contains HOST clause(s).

I hope this helps. It looks similar, but a different layout a bit than yours. Maybe try doing it this way?

NOTE: I am running DNS server right on that machine too; if you are not, then obviously you'll be wanting to give some external nameserver address


Best of luck,
Sasha

Last edited by GrapefruiTgirl; 12-01-2009 at 01:03 PM.
 
1 members found this post helpful.
Old 12-01-2009, 02:39 PM   #6
Peter_Karlsen
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
I tried adding a subnet for eth0. And a few other things. Still no luck
eth0 is connected to my ISP, and I have no control over which IP I get assigned. Could this end up being a problem?

Is the option domain-name needed for my dhcp server to work? I don't have a domain name anyway.

After changes my dhcpd.conf looks like this:

# Local Network
ddns-update-style none;
authoritative;
option domain-name "example.org";
option domain-name-servers 194.239.134.83, 193.162.153.164;
log-facility local7;
option ip-forwarding off;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.32 192.168.1.49;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
allow unknown-clients;
group {
option domain-name-servers 194.239.134.83 , 193.162.153.164;
# HP LaserJet 1200N
host LaserJet1200 {
hardware ethernet 00:01:e6:90:9c:61;
fixed-address 192.168.1.50;
}
}
}

subnet 80.197.49.128 netmask 255.255.255.128 {
}



/Peter
 
Old 12-01-2009, 03:18 PM   #7
Peter_Karlsen
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Problem Solved!!!

I removed dhcpd version 4.1
Then I downloaded, compiled and installed dhcpd version 3.1.3
The dhcp.conf is the same, but now it works!!

Thanks a lot Sasha for your fast responses and good ideas. I wouldn't have solved it without your help.

/Peter
 
Old 12-01-2009, 03:59 PM   #8
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by Peter_Karlsen View Post
Problem Solved!!!

I removed dhcpd version 4.1
Then I downloaded, compiled and installed dhcpd version 3.1.3
The dhcp.conf is the same, but now it works!!

Thanks a lot Sasha for your fast responses and good ideas. I wouldn't have solved it without your help.

/Peter
Bango!! You know what!? Above, where I mentioned that I had to downgrade my DHCP server before the client would listen to it? SAME PROBLEM -- I had upgraded to version 4.xx and nothing would work (on the Windows machine anyhow). I was stumped. After downgrading to 3.1.2 again, it instantly worked great all around.

dunno what it is with version 4.x..

Anyhow, that's great glad you got it fixed. And if it is, you can mark this thread [solved] if you like, using the Thread Tools menu near the top of the thread.

Best regards,
Sasha
 
1 members found this post helpful.
  


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
Problem assigning default gateway to clients through dhcpd (ubuntu) milpoer Linux - Networking 2 04-16-2009 08:05 AM
DHCPD-3 not adding DNS entries for Linux clients mobiusNZ Linux - Networking 2 03-11-2007 08:47 PM
DHCPD Not Giving Out Addresses Trano Linux - Networking 4 04-16-2005 12:12 AM
RH9 and DHCPD issues with some clients paradigm Linux - Networking 5 11-03-2003 03:08 AM
Serving DNS IP to Macintosh clients via DHCPD Darieus Linux - Networking 1 08-08-2003 10:06 AM

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

All times are GMT -5. The time now is 06:32 AM.

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