KanREN DHCP Seminar November 7-9, 2005

Host Declaration and Fixed Address

Currently, the server is handing out all dynamic leases, with no reservations for specific clients. To provide a reservation, you need to identify the client and associate it with the IP address it should get.

First, find the MAC (hardware) address of your computer. On a PC, run ipconfig /all and look for the physical address. On a Mac, run ifconfig and look for the ether line. The address you find should look something like 00:03:93:72:c1:d2.

Create a new configuration file called dhcpd.conf-hosts to hold your host reservations. In the file, make an entry something like this, substituting your own MAC address, and an IP address appropriate for your subnet. The name of the host declaration is arbitrary, so pick something that makes sense to identify your computer.

host neufeld-mac {

hardware ethernet 00:03:93:72:c1:d2;

fixed-address 192.168.10.100;

}

Then in the main dhcpd.conf file, make a reference to the dhcpd.conf-hosts file:

# Include host declarations

include "dhcpd.conf-hosts";

To activate your configuration, stop and restart the server.

lab1:/var/dhcp # kill `cat dhcpd.pid`

lab1:/var/dhcp # dhcpd

Internet Systems Consortium DHCP Server V3.0.4b2

Copyright 2004-2005 Internet Systems Consortium.

All rights reserved.

For info, please visit http://www.isc.org/sw/dhcp/

Wrote 1 leases to leases file.

Listening on BPF/xl0/00:50:da:10:e5:8c/192.168.10/24

Sending on BPF/xl0/00:50:da:10:e5:8c/192.168.10/24

Sending on Socket/fallback/fallback-net

lab1:/var/dhcp #

Now renew the DHCP lease on your client, and you should get the .100 IP address instead of the .63 that you had before. Double-check that you still have full Internet connectivity—a fixed-address assignment shouldn't impact any other settings.

vlan402-dhcp11:~ neufeld$ telnet leela.kanren.net 22

Trying 164.113.130.2...

Connected to 164.113.130.2.

Escape character is '^]'.

SSH-1.99-OpenSSH_3.6.1p1 FreeBSD-20030924

^]

telnet> quit

Connection closed.

Success!

2005-11-07T09:22:35