# dhcpd isn't working while it should

## cz0

Hi, folks.

I have some strange behavior with dhcpd-4.2.5. Here is my /etc/dhcp/dhcpd.conf

```

option domain-name "deep";

authoritative;

log-facility local7;

ddns-update-style none;

subnet 10.0.0.0 netmask 255.255.255.0 {

        range 10.0.0.8 10.0.0.16;

        default-lease-time 14400;

        max-lease-time 86400;

        option domain-name-servers 10.0.0.1;

        option routers 10.0.0.1;

        option ntp-servers 10.0.0.1;

        option broadcast-address 10.0.0.255;

}

subnet 10.0.1.0 netmask 255.255.255.0 {

        range 10.0.1.8 10.0.1.16;

        default-lease-time 3600;

        max-lease-time 7200;

        option domain-name-servers 10.0.1.1;

        option routers 10.0.1.1;

        option broadcast-address 10.0.1.255;

}

```

I have my 10.0.0.1/24 subnet up and running:

```

eth4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.0.0.1  netmask 255.255.255.0  broadcast 10.0.0.255

        ether 00:0e:04:b7:1b:9d  txqueuelen 1000  (Ethernet)

        RX packets 2410685  bytes 2188420214 (2.0 GiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 3298697  bytes 3496109402 (3.2 GiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

And dhcpd listening on *:67

```

netstat -aupn

.

udp        0      0 0.0.0.0:67              0.0.0.0:*                           2988/dhcp

.

```

But, if I start dhcp client on the other puter, that connected to the same network, I get no address and timeouts:

```

dhcpcd --nobackground --noipv4ll --nohook resolv.conf --clientid="" eth0 test

dhcpcd[24671]: version 5.6.4 starting

dhcpcd[24671]: all: configured as a router, not a host

dhcpcd[24671]: test: interface not found or invalid

dhcpcd[24671]: eth0: broadcasting for a lease

dhcpcd[24671]: timed out

```

If I start tcpdump on dhcp server, I can see messages like this:

```

tcpdump -i eth4 -p udp 'port 67 or port 68'

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

listening on eth4, link-type EN10MB (Ethernet), capture size 65535 bytes

22:13:49.431244 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 90:e6:ba:f0:51:15 (oui Unknown), length 337

22:13:53.244226 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 90:e6:ba:f0:51:15 (oui Unknown), length 337

22:14:02.137926 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 90:e6:ba:f0:51:15 (oui Unknown), length 337

```

But no DHCPDESCOVER.

I have iptables running on that server, but AFAIR DHCP work under that, so no special rules needed. Any ideas?

----------

## Moriah

If you are not facing anything threatening with the dhcp server, my first step would be to disable iptables and try again.  If it works, then you need to make some rule changes; if it still doesn't work, then turn iptables back on.

----------

## Maitreya

Have you tried making a pool for the dhcpd server to give ip addresses out of?

Or maybe try and add a fixed entry?

It could be ignoring unknown clients "allow unknown-clients;" is a option if you want to redirect these unasigned peers to a pool.

----------

## cz0

OK, I will try to disable iptables for beginning, but this is a little bit tricky just because it's a real router and that will disable all routing for other users behind it.

2 Maitreya: I have a fixed address for my workstation (by MAC), but that isn't working ether.

----------

## cz0

And another intersting thing I forgot about: that DHCP work fine for 10.0.1.0/24 (my local wifi net). I can connect with my droid cell phone, receiving 10.0.1.13.

----------

