Exclude one MAC Addrr from dhcp range

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Mar 6 18:38:33 UTC 2009


Jorge Bastos wrote:

>I'm a user of DHCPD for almost 10 years, and never had the need of:
>
>Exclude 2 MAC Addrr's from the rage, is this possible? If so how?
>I've tried to check the manual but didn't saw what I need, maybe 
>didn't saw it correctly.
>
>Dhcpd 3.0.x, and my conf is:
>
>server-identifier 192.168.1.1;
>
>#ddns-update-style ad-hoc;
>subnet 192.168.1.0 netmask 255.255.255.0 {
>   range 192.168.1.100 192.168.1.200;
>   default-lease-time 60000;
>   max-lease-time 72000;
>   option subnet-mask 255.255.255.0;
>   option broadcast-address 192.168.1.255; # ddns-update-style 
>ad-hoc; #  option netbios-name-servers 192.168.1.1, 192.168.1.1; # 
>option netbios-dd-server 192.168.1.1;
>   option domain-name "int.pt";
>   option domain-name-servers 192.168.1.254 ; #  option 
>domain-name-servers 192.168.1.1;
>   option netbios-node-type 8;
>#  option static-routes 0.0.0.0 192.168.1.1;
>   option routers 192.168.1.254;
>}

It's something that's come up on the list many times in various disguises.

Firstly, can you clarify what exactly you want to achieve ? Do you want to :

a) Deny requests from those devices
b) Given them an address elsewhere in the subnet
c) something else

Also, do you definitely mean "exclude MAC addresses", and not 
"exclude IP address" ?

Probably the simplest way to deal with two specific devices would be 
with a host statement like this :

host bad-device-1 {
   hardware ethernet aa:bb:cc:dd:ee:ff ;
   deny booting ;
}

or

host bad-device-1 {
   hardware ethernet aa:bb:cc:dd:ee:ff ;
   fixed-address a.b.c.d ;
}

The first would simply refuse to service the device, the second would 
give it a fixed address (which must NOT be included in the dynamic 
range).

The label "bad-device-1" is purely a text label for the benefit of 
the administrator - it doesn't matter what it is, but it must be 
unique for each host declaration.

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the dhcp-users mailing list