Configuration question..

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Sep 14 07:14:44 UTC 2006


B. Cook wrote:

>  >>> The webmin gui doesn't show us the defined hosts we have, and we can't
>>>>  figure out where/how to add them.. so I started to think that somehow
>  >>> our config is incorrect..

I know it's going back a bit, but webmin doesn't support all possible 
configurations - for simplicity it supports only a subset of what the 
server is capable of. Thus it is quite conceivable that a manually 
configured file won't be fully & correctly parsed by webmin.



># dhcpd.conf
>
>authoritative;
>other_global_options;
>
>subnet 192.168.1.0 netmask 255.255.255.0 {
>global_settings_for_this_subnet;
>
>pool {
>	deny unknown clients;
>	range 192.168.1.100 192.168.1.105;
>	}
>
>group {
>	option routers 0.0.0.0;
>	host one	{ hardware ethernet aa:bb:cc:dd:ee:f1; fixed-address
>192.168.1.99; }
>	}
>
>host two	{ hardware ethernet aa:bb:cc:dd:ee:f2; fixed-address
>192.168.1.98; }
>host three	{ hardware ethernet aa:bb:cc:dd:ee:f3; }
>
>pool {
>	allow unknown clients;
>	range 192.168.1.20 192.168.1.25;
>	option domain-name-servers 0.0.0.0;
>	}
>
>} # close subnet 192.168.1.0/24
>
>
># public network
>subnet 10.0.0.0 netmask 255.255.255.128 {
>other_options_here;
>option router 10.0.0.87;
>
>pool {
>	allow unknown clients;
>	range 10.0.0.95 10.0.0.125;
>	}
>
>group {
>	option routers 10.0.0.62;
>	host something	{ hardware ethernet 11:22:33:44:55:61; fixed-address
>10.0.0.5; }
>	}
>
>host another	{ hardware 11:22:33:44:55:62; }
>
>} # close subnet 10.0.0.0/25
>
>
>This still gives me warnings:
>WARNING: Host declarations are global.  They are not limited to the
>scope you declared them in
>
>do I need to define the hosts outside the subnets even? but if I do that
>how will it know what hosts to apply what to?  how would it tell the
>different between hosts one, two and another? Or am I just missing
>something that should be glaringly obvious?


Let me re-arrange that for you into what is considered a 
'conventional' arrangement. Note the indentation that clearly shows 
the nesting AND makes it easier to see which closing '}' belongs to 
what.

# dhcpd.conf

authoritative;
other_global_options;

subnet 192.168.1.0 netmask 255.255.255.0 {
   global_settings_for_this_subnet;

   pool {
     deny unknown clients;
     range 192.168.1.100 192.168.1.105;
   }


   pool {
     allow unknown clients;
     range 192.168.1.20 192.168.1.25;
     option domain-name-servers 0.0.0.0;
   }

} # close subnet 192.168.1.0/24


# public network
subnet 10.0.0.0 netmask 255.255.255.128 {
   other_options_here;
   option router 10.0.0.87;

   pool {
     allow unknown clients;
     range 10.0.0.95 10.0.0.125;
   }

} # close subnet 10.0.0.0/25


group {
   option routers 0.0.0.0;
   host one { hardware ethernet aa:bb:cc:dd:ee:f1; fixed-address 192.168.1.99; }
}

host two { hardware ethernet aa:bb:cc:dd:ee:f2; fixed-address 192.168.1.98; }
host three { hardware ethernet aa:bb:cc:dd:ee:f3; }

group {
   option routers 10.0.0.62;
   host something { hardware ethernet 11:22:33:44:55:61; fixed-address 
10.0.0.5; }
}

host another { hardware 11:22:33:44:55:62; }



>Starting dhcpd.
>Internet Systems Consortium DHCP Server V3.0.5rc2
>Copyright 2004-2006 Internet Systems Consortium.
>All rights reserved.
>For info, please visit http://www.isc.org/sw/dhcp/
>lease 10.0.0.82: no subnet.
>lease 10.0.0.84: no subnet.
>lease 10.0.0.72: no subnet.
>lease 10.0.0.69: no subnet.
>lease 10.0.0.85: no subnet.
>lease 10.0.0.94: no subnet.
>lease 10.0.0.71: no subnet.
>lease 10.0.0.86: no subnet.
>lease 10.0.0.92: no subnet.
>lease 10.0.0.93: no subnet.
>Wrote 0 deleted host decls to leases file.
>Wrote 0 new dynamic host decls to leases file.
>Wrote 80 leases to leases file.
>Listening on BPF/fxp0/00:e0:18:03:d0:3c/192.168.1/24
>Sending on   BPF/fxp0/00:e0:18:03:d0:3c/192.168.1/24
>Sending on   Socket/fallback/fallback-net
>
>so I looked in my dhcpd.conf to see what was up w/ those hosts.. and
>they looked fine..

Note 'host' is not the same as 'lease' - so looking to see "what's up 
with those hosts" doesn't make sense. What I suspect is that you've 
had a range statement that included 10.0.0.69 (or lower) to 10.0.0.93 
and removed it from the config. During startup, the server has gone 
through the leases file, found no valid range that the lease can 
belong to, and therefore deleted it from the lease database.


>then I had another strange thing..
>
>one host on the 10 could not get an ip..
>Sep 13 10:23:31 isc dhcpd: DHCPDISCOVER from 00:40:96:35:17:a0 via
>10.0.0.62: network 10.0.0.0/25: no free leases
>
>grep 17:a0 /var/log/dhcpd.log
>Sep 13 08:30:48 isc dhcpd: DHCPDISCOVER from 00:40:96:35:17:a0 via 10.0.0.62
>Sep 13 08:30:48 isc dhcpd: DHCPOFFER on 10.0.0.9 to 
>00:40:96:35:17:a0 via 10.0.0.62
>Sep 13 08:30:48 isc dhcpd: DHCPREQUEST for 10.0.0.9 (192.168.1.248) 
>from 00:40:96:35:17:a0 via 10.0.0.62
>Sep 13 08:30:48 isc dhcpd: DHCPACK on 10.0.0.9 to 00:40:96:35:17:a0 
>via 10.0.0.62
>Sep 13 08:31:46 isc dhcpd: DHCPACK to 10.0.0.9 (00:40:96:35:17:a0) via fxp0
>Sep 13 08:31:49 isc dhcpd: DHCPACK to 10.0.0.9 (00:40:96:35:17:a0) via fxp0
>Sep 13 09:27:09 isc dhcpd: DHCPREQUEST for 10.0.0.9 from 
>00:40:96:35:17:a0 via 10.0.0.62
>Sep 13 09:27:09 isc dhcpd: DHCPACK on 10.0.0.9 to 00:40:96:35:17:a0 
>via 10.0.0.62
>Sep 13 09:32:56 isc dhcpd: DHCPACK to 10.0.0.9 (00:40:96:35:17:a0) via fxp0
>Sep 13 09:32:59 isc dhcpd: DHCPACK to 10.0.0.9 (00:40:96:35:17:a0) via fxp0
>Sep 13 10:23:30 isc dhcpd: DHCPREQUEST for 10.0.0.9 from 
>00:40:96:35:17:a0 via 10.0.0.62: lease 10.0.0.9 unavailable.
>Sep 13 10:23:30 isc dhcpd: DHCPNAK on 10.0.0.9 to 00:40:96:35:17:a0 
>via 10.0.0.62
>Sep 13 10:23:31 isc dhcpd: DHCPDISCOVER from 00:40:96:35:17:a0 via 
>10.0.0.62: network 10.0.0.0/25: no free leases

OK, in the morning, you had a pool/range that the client was allowed 
an address from. My guess is that this host has a host declaration 
without a fixed address in the 10.0.0.0 network. You have removed 
that pool/range so now there is no pool in the 10.0.0.0 network which 
is allowable to known clients.

The result is that the address the client previously had is no longer 
valid - hence the "lease ... unavailable" message and the DHCPNAK 
response. When the client then does a DHCPDISCOVER, there are no 
leases that the server is allowed to give out and so there are "no 
free leases" - in situations like this, "no free leases" doesn't mean 
that there really are no leases at all in the subnet, it means that 
there is nothing that the server is allowed to hand out.


>I finally had to assign it a static IP..

At which point, the server now has an address it can give the client.



>I tried to test it out w/ a laptop.. that was assigned an ip from the
>dynamic range of the 10. (10.0.0.80) I removed that, released the IP
>from the client, restarted dhcpd, saw this:
>
>Stopping dhcpd.
>Starting dhcpd.
>Internet Systems Consortium DHCP Server V3.0.5rc2
>Copyright 2004-2006 Internet Systems Consortium.
>All rights reserved.
>For info, please visit http://www.isc.org/sw/dhcp/
>lease 10.0.0.81: no subnet.
>lease 10.0.0.80: no subnet.
>lease 10.0.0.80: no subnet.
>lease 10.0.0.80: no subnet.
>lease 10.0.0.80: no subnet.

See above for this bit


>tail'ed the log and had the laptop renew its ip and saw this:
>
>Sep 13 10:35:46 isc dhcpd: DHCPDISCOVER from 00:14:a4:25:81:b4 via 10.0.0.62
>Sep 13 10:35:47 isc dhcpd: DHCPOFFER on 10.0.0.119 to 
>00:14:a4:25:81:b4 (Laptop-8) via 10.0.0.62
>Sep 13 10:35:49 isc dhcpd: DHCPDISCOVER from 00:14:a4:25:81:b4 
>(Laptop-8) via 10.0.0.62
>Sep 13 10:35:49 isc dhcpd: DHCPOFFER on 10.0.0.119 to 
>00:14:a4:25:81:b4 (Laptop-8) via 10.0.0.62
>Sep 13 10:35:58 isc dhcpd: DHCPDISCOVER from 00:14:a4:25:81:b4 
>(Laptop-8) via 10.0.0.62
>Sep 13 10:35:58 isc dhcpd: DHCPOFFER on 10.0.0.119 to 
>00:14:a4:25:81:b4 (Laptop-8) via 10.0.0.62
>Sep 13 10:35:58 isc dhcpd: DHCPREQUEST for 10.0.0.119 
>(192.168.1.248) from 00:14:a4:25:81:b4 (Laptop-8) via 10.0.0.62
>Sep 13 10:35:58 isc dhcpd: DHCPACK on 10.0.0.119 to 
>00:14:a4:25:81:b4 (Laptop-8) via 10.0.0.62
>
>all looked fine..
>
>so I wonder why that other machine could not get an IP and would not..

10.0.0.119 is in the pool allowed for unknown hosts - therefore I 
conclude that this laptop doesn't have a host statement and is an 
unknown host. The difference is between 'known' and 'unknown'.


Simon




More information about the dhcp-users mailing list