Subject: Re: NetBSD-1.4: DHCP setup
To: John Nemeth <jnemeth@victoria.tc.ca>
From: Ted Lemon <mellon@isc.org>
List: port-sparc
Date: 06/16/1999 11:46:06
> I know this thread has been discussed pretty thoroughly, but, there
> is a syntax error in the above line, that nobody else seems to have
> caught.
It's not a syntax error - just a violation of the suggested protocol
for choosing client identifiers. In practice, not terribly
significant, but probably worth correcting just so you don't get in
the habit of doing it wrong... :')
> How do you dhcpd to give a client a fixed address based on either the
> hostname, or the dhcp-client-identifier (preferably the hostname)?
You write a host declaration, and within that a hardware declaration
or an "option dhcp-client-identifier ...;" statement, and also a
fixed-address declaration. For example:
host foo {
hardware ethernet 8:0:20:10:1d:55;
fixed-address 10.0.0.18;
}
or
host bar {
option dhcp-client-identifier 1:8:0:20:10:1d:55;
fixed-address 10.0.0.18;
}
There's no real percentage in specifying both hardware and client
identifier unless your client might be using BOOTP for one phase of
its boot and DHCP for a second phase (BOOTP doesn't do DHCP client
identifiers).
> The second question is does anybody have any sample scripts that use
> the new dhclient-script hooks. What I want is a script that will
> execute a command, anytime the IP address changes. As you can
> probably guess, this is for registering a dynamic address.
#!/bin/sh
if [ x$old_ip_address != x$new_ip_address ]; then
do your stuff
fi
# Don't exit...
_MelloN_