# DHCP is started but no-one can get IP's

## Thrifty

Hi All,

I have DHCP configured and have the correct interfaces set in /etc/conf.d/dhcpd and have also tried the -d option to no avail.

None of the clients can get ip's and there are no errors, I have tried disabling the firewall which makes no difference and have tried on 3 different client machines.

Any ideas what it could be????

----------

## Chris W

Your server is misconfigured is my guess.  Can you tell us what version of what package?    What does your config file look like (/etc/dhcp/dhcpd.conf)?  What is going into syslog?

----------

## Thrifty

Hi, I have tried both the below configs with the appropriate network cards entered in conf.d/dhcp with the same results.  The syslog entry is always:

Nov 18 19:07:30 gw01 dhcpd: Wrote 0 leases to leases file.

## SECOND ONE TRIED AFTER FIRST ONE DIDNT WORK###

default-lease-time 600;

max-lease-time 7200;

ddns-update-style ad-hoc;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.90.255;

option routers 192.168.90.250;

option domain-name-servers 192.168.90.250;

option domain-name "steeldrafting.co.nz";

option netbios-name-servers 192.168.90.1;

subnet 192.168.90.0 netmask 255.255.255.0 {

range 192.168.90.11 192.168.90.249;

}

### FIRST ONE TRIED ####

ddns-update-style ad-hoc;

default-lease-time 600;

max-lease-time 7200;

subnet 192.168.90.0 netmask 255.255.255.0 { authoratative;

        range 192.168.90.11 192.168.90.249;

        option broadcast-address 192.168.90.255;

        option subnet-mask 255.255.255.0;

        option routers 192.168.90.250;

        option domain-name "napier.turbogroup.co.nz";

        option domain-name-servers 192.168.90.250;

        option netbios-name-servers 192.168.90.1;

        option netbios-node-type 8;

        ddns-domainname "napier.turbogroup.co.nz";

        ddns-rev-domainname "in-addr.arpa";

        }

subnet 192.168.91.0 netmask 255.255.255.0 { authoratative;

        range 192.168.91.11 192.168.91.249;

        option broadcast-address 192.168.91.255;

        option subnet-mask 255.255.255.0;

        option routers 192.168.91.10;

        option domain-name "napier.turbogroup.co.nz";

        option domain-name-servers 192.168.90.250;

        option netbios-name-servers 192.168.90.1;

        option netbios-node-type 8;

#       option proxy-definition-url "http://192.168.1.1/wpad.dat";

        ddns-domainname "napier.turbogroup.co.nz";

        ddns-rev-domainname "in-addr.arpa";

        }

subnet 192.168.99.0 netmask 255.255.255.0 { authoratative;

        range 192.168.99.11 192.168.99.249;

        option broadcast-address 192.168.99.255;

        option subnet-mask 255.255.255.0;

        option routers 192.168.99.250;

        option domain-name "napier.turbogroup.co.nz";

        option domain-name-servers 192.168.90.250;

        option netbios-name-servers 192.168.90.1;

        option netbios-node-type 8;

#       option proxy-definition-url "http://192.168.1.1/wpad.dat";

        ddns-domainname "napier.turbogroup.co.nz";

        ddns-rev-domainname "in-addr.arpa";

        }

----------

## Chris W

The only obvious difference between your config and mine is the absence of the:

```
authoritative;
```

 directive at the top of the file. From the man page: *Quote:*   

> Network  administrators  setting  up  authoritative DHCP servers for their networks should always write  authoritative;  at  the  top  of their  configuration  file  to  indicate that the DHCP server should send DHCPNAK messages to misconfigured clients.    If  this  is  not done,  clients  will  be  unable  to  get a correct IP address after changing subnets until their old lease has expired, which could take quite a long time. 

  Maybe never  :Sad: 

Hope this helps.

----------

## ke.batty

Do you have "DHCPDISCOVER" and/or "DHCPREQUEST" messages in your logs ?  Are they from the port you expected ?  If so, client requests are getting to the dhcpd, if not the dhcpd is listening on the wrong port (look for "dhcpd: Listening" in logs), or the clients requests are not getting to the dhcpd, unsure how to troubleshoot that one.

Do you have "DHCPACK" or "DHCPNAK" messages ?  Are they from the port you expected? If DHCPACK then the dhcpd is working ok and your clients are not picking up the allocation.  if DHCPNAK the dhcpd cannot give the client the requested IP, this may be a client config problem.

----------

## Thrifty

Hi, I have NONE of those messages in the log.

I have set the -d option and am running "tail -f /var/log/syslog"

top see the output and nothing!!!!

----------

## Chris W

When you start the DHCP daemon does it output anything like:

```
# /etc/init.d/dhcp restart

 * Stopping dhcpd...                                                      [ ok ]

 * Setting ownership on dhcpd.leases...                                   [ ok ]

 * Starting dhcpd...

Internet Software Consortium DHCP Server V3.0pl2

Copyright 1995-2003 Internet Software Consortium.

All rights reserved.

For info, please visit http://www.isc.org/products/DHCP

Wrote 0 deleted host decls to leases file.

Wrote 0 new dynamic host decls to leases file.

Wrote 4 leases to leases file.

Listening on LPF/eth1/xx:xx:xx:xx:xx:xx/192.168.1.0/24

Sending on   LPF/eth1/xx:xx:xx:xx:xx:xx/192.168.1.0/24

Sending on   Socket/fallback/fallback-net                                 [ ok ]
```

 where the addresses match the interfaces you think you're listening on?  This output also goes into the syslog.

Have you checked after starting that it is actually running and listening? 

```
# ps -ef | grep dhcp

dhcp     31679     1  0 18:48 ?        00:00:00 /usr/sbin/dhcpd -user dhcp -group dhcp eth1

root     31709 31510  0 18:52 pts/1    00:00:00 grep dhcp

# netstat -pa --inet | grep bootps

udp        0      0 *:bootps                *:*                                 31796/dhcpd
```

Have you tried running the daemon manually to catch output? 

```
# /usr/sbin/dhcpd -d -f -user dhcp -group dhcp eth1
```

Did you try the 'authoritative;' flag I posted about earlier?

Check where your syslog/syslog-ng/metalog configuration is sending output for the 'daemon' facility - perhaps you are silently discarding it.

----------

## madmango

Unless you set authoritive, your server won't really send out IPs.

You also need to put all your option flags UNDER the subnet declaration. Options are subnet-specific.

----------

## ronmon

Yeah, my working configuration looks quite a bit different than yours. I have no such file as /etc/conf.d/dhcpd, but I do have a /etc/conf.d/dhcp. It has two options set:

```

IFACE="br0"

DHCPD_OPTS="-N"

```

The IFACE option serves IP addresses to a specific interface (i.e. your LAN). I don't remember what -N does and can't find it in the man pages right now.

My /etc/dhcp/dhcpd.conf (trimmed) looks like this:

```

#Global settings

authoritative;

ddns-update-style interim;

option domain-name "ronmon.shacknet.nu";

option domain-name-servers 192.168.0.1;

log-facility local7;

#Subnet specific settings

subnet 192.168.0.0 netmask 255.255.255.0 {

  range 192.168.0.4 192.168.0.254;

  option domain-name "ronmon.shacknet.nu";

  option routers 192.168.0.1;

  option broadcast-address 192.168.0.255;

  default-lease-time 72000;

  max-lease-time 144000;

}

#My desktop's 10/100 and the laptop's 802.11b get fixed addresses

host mimi {

  hardware ethernet 00:02:2A:AA:BB:CC;

  fixed-address 192.168.0.2;

}

host mack {

  hardware ethernet 00:02:2D:DD:EE:FF;

  fixed-address 192.168.0.3;

}

```

----------

