I am trying to enable DHCP so that it will give out IP’s to some XP boxes when they boot. I have had success doing it dynamically, but not statically using the host declaration.
host xpTest {
hardware ethernet 00:50:56:2A:3B:00;
fixed-address 192.168.100.2;
}
My question is, what should the subnet declaration be if I only want to hand out static IP’s like this? Also, the host is the same name that is specified in /etc/hosts correct?
The host declaration should be contained within the same subnet declaration. Here’s an example:
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.128 192.168.1.191;
host xterm {
hardware ethernet 00:02:55:08:AA:F9;
fixed-address 192.168.1.20;
}
}
That declares a dynamic range from .128 to .191 inclusive and a static address assignment of .20.
The name after host is of no importance, except that it must be unique within the DHCP config.
Yes that seems to work, but even if I do not specify a range in the dhcpd.conf and only use host declarations, I still get these messages in the log
Dynamic and static leases present for 192.168.100.2.
vcl dhcpd: Remove host declaration xpTest or remove 192.168.100.2
from the dynamic address pool for 192.168.100/24
It is dynamically assigning addresses even though I have not specified a range to do so in the dhcpd.conf file.
Is it possible to do this only statically?
It looks like you have some kind of dynamic pool already declared somewhere. There is also a pool statement in this dhcpd. Look again at the config files. Another possibility is you have some stale leases in /var/lib/dhcp/db/dhcpd.leases.