How do i specify static IP's in dhcpd.conf

Soldato
Joined
18 May 2010
Posts
22,371
Location
London
So we have a old DHCP server that is being decommissioned and the static IP reservations on that are defined outside the DHCP subnet.

I tried to do the same on the new one and I was getting an ARP timeout. Looking everywhere for the solution I thought I'd try defining the static reservation within the DHCP subnet and WOOP it works.

I thought I'd solved it. But alas not. Now DHCP leases are not being offered.

So how the bleep do you get this to work?


This is what I have:

subnet 172.23.160.0 netmask 255.255.255.0 {
pool
{
range 172.23.160.131 172.23.160.140;
}

option subnet-mask 255.255.255.0;
option routers 172.23.160.1;
}
subnet 172.23.170.0 netmask 255.255.255.0 {}
subnet 172.23.180.0 netmask 255.255.255.0 {

pool
{
range 172.23.110.110 172.23.110.140;
}

option subnet-mask 255.255.255.0;
option routers 172.23.110.1;


host blabla {
hardware ethernet XX:XX:XX:XX:XX:XX:XX;
fixed-address 172.23.110.114;
option host-name "blabla";
option subnet-mask 255.255.255.0;
option routers 172.23.110.1;
filename "pxelinux.0";
next-server 172.23.200.100;
}
}

If I remove the static host declaration DHCP works again. I've tried putting the host block out side the subnet declaration but it only looks at the DHCP lease and then times out because it can find the mac address.

Maybe I need an if else statement in there?
 
Last edited:
Back
Top Bottom