Exclude IP address from DHCP pool

Is there a way to exclude an ip address from dhcp pool? For various reasons i have a machine that I can't reconfigure or move off the network (lets call it a printer). It has been hard coded an x.x.x.50 address and my dhcp pool is x.x.x.10 -> x.x.x.246. I don't want to have 2 pool definitions for this one subnet to cover each side of this machine. Is there some form of 'exclude ip' argument/option? I'm using ubuntu 11 and the isc-dhcp package.

DISCLAIMER: i have googled and it only came up with IoS and juniper info.


Solution 1:

Why don't you set the IP for that appliance explicitely:

# The standard subnet
subnet 10.0.0.0 netmask 255.255.255.0 {
    option domain-name "ourdomain.internal";
    option routers 10.0.0.1;
    option domain-name-servers 10.0.0.2;
    range 10.0.0.10 10.0.0.49;
    range 10.0.0.51 10.0.0.246;
}


#has hardcoded ip, and dhcp should not use that in pool
host fixedipappliance {
    hardware ethernet 10:4e:ed:co:ff:ee;
    fixed-address 10.0.0.50;
}

I just successfully testet a configuration with two ranges like that. Multiple range statement are legal, as mentioned in the manpage:

The range statement

  range [ dynamic-bootp ] low-address [ high-address];

For any subnet on which addresses will be assigned dynamically, there must be at least one range statement. The range statement gives the lowest and highest IP addresses in a range. All IP addresses in the range should be in the subnet in which the range statement is declared. The dynamic-bootp flag may be specified if addresses in the specified range may be dynamically assigned to BOOTP clients as well as DHCP clients. When specifying a single address, high-address can be omit‐ ted.

Solution 2:

I think you want to do static DHCP assignment. See if this help. http://www.miquels.cistron.nl/isc-dhcpd/ http://forums.whirlpool.net.au/archive/309440