Identify dhcp client to server using hostname
I am trying to allocate ip-addresses on my local network using
dhcp3-server. I want a couple of systems to have a fixed address,
while other system should get any ip that is still available.
I have created a range of dynamic ip-numbers and have tried to find
a way to identify those hosts that need a fixed address using host
statements.
When I add a "hardware ethernet HWADDR"-statement to a host
definition, everything works as expected. However I don't want to
use MAC-addresses, since sometimes I boot a live-cd or another
operating system in which case I'd like to use an ip from the
dynamic range.
I have tried changing the "send host-name" option in dhclient.conf,
but this seems to get happily ignored.
These are the relevant parts from dhcpd.conf on the server:
----------------------------------------------
option domain-name "mydomain.net";
option domain-name-servers 10.0.0.138;
option routers 192.168.1.3;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.11 192.168.1.19;
}
host myhost {
# hardware ethernet 00:10:A7:10:83:B8;
fixed-address 192.168.1.7;
}
----------------------------------------------
The only uncommented line in dhclient.conf on the client:
----------------------------------------------
send host-name "myhost";
----------------------------------------------
When I uncomment the hardware statement, I get 192.168.1.7,
otherwise I get something from the 11-19 range. Is it possible to
use a different identifier (ideally the host name) and if so what
statements are needed in the different config-files?
Thanks,
Bob
Reply to: