dhcpd for only one mac
Carl Karsten
carl at personnelware.com
Sat Feb 7 17:49:42 UTC 2009
Simon Hobson wrote:
> 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 ?
oh yeah, that would have been helpful :) Seems you read my mind pretty good.
>
> 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.
I am going to be doing this testing / demoing for the next week or so, and dhcpd
is running on my laptop. So im trying to make sure that as I move my laptop
around and connect to random networks I don't start handing out IP's to other
machines on those networks.
>
> 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.
>
This sounds like exactly what I was hoping for. Thanks a bunch.
Carl K
More information about the dhcp-users
mailing list