dhcpd for only one mac

Simon Hobson dhcp1 at thehobsons.co.uk
Sat Feb 7 09:52:21 UTC 2009


Carl Karsten wrote:
>I want to bring up a 2nd dhcp server to test some things.  I only 
>want it to respond to one mac so that it does not interfere with the 
>rest of the lan.
>
>I realize the 'one mac' machine may get a response from the other 
>dhcp server. with a little cable plugging unplugging I can isolate 
>it.  I need to have the box running dhcpd on the LAN, and even 
>though I could start/stop the service, that makes me nervous.  and 
>its an extra hassle I would like to avoid.
>
>subnet 192.168.1.0  netmask 255.255.255.0 {
>         hardware ethernet 00:60:08:0b:98:09 ;
>         option host-name "testme" ;
>         range 192.168.1.10 192.168.1.254 ;
>         option cz_ocs_daemonon "ssh";
>}

And the question is ?

Well assuming the question you meant to ask was "how can you do it", then ...

Like most things, there are several ways to do this.

One method, not involving DHCP setup would be to build yourself a 
bridge, put it between your test server & client and the rest of the 
lan, and program it to pass all traffic except DHCP.

Alternatively, we need to configure your test server to ignore 
everything except your single client. From the snippet above, I'm 
guessing that you are using your own subnet for this (ie separate to 
the rest of the lan). IN that case you would need something like this 
(you'll need to set the right IPs etc) :

shared network "testnet" {
   subnet 10.0.0.0 netmask 255.255.255.0 {
     ignore booting ;
   }

   subnet 192.168.1.0  netmask 255.255.255.0 {
     range 192.168.1.10 192.168.1.254 ;
     option routers 192.168.1.1 ;
     ignore unknown clients ;
   }
}

host "testhost" {
   hardware ethernet 00:60:08:0b:98:09 ;
   option host-name "testme" ;
   option cz_ocs_daemonon "ssh";
}

What this does is make your test subnet and the existing subnet into 
a shared network, it then tell the server to ignore all clients 
except those with a host statement. It is NOT authoritative however, 
so will not explicitly tell anything (including your test client) to 
stop using an invalid address - you may be able to turn authoritative 
on, I'm not 100% that the server will still honour the "ignore 
booting" statements.

-- 
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