11Jun/110
How to install a IPv4 DHCP server on FreeBSD
This manual describes how to install a DHCP daemon for IPv4 usage.
First install the required port.
cd /usr/ports/net/isc-dhcp41-server/ make install clean
Build dhcpd config
# dhcpd.conf
# option definitions common to all supported networks...
#option domain-name "server.domain.tld";
option domain-name-servers 172.22.21.1;
default-lease-time 300;
max-lease-time 3600;
# Use this to enble / disable dynamic dns updates globally.
ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# Prevent duplicates!
deny duplicates;
### LAN 1 ###
subnet 172.22.21.0 netmask 255.255.255.0 {
range 172.22.21.40 172.22.21.49;
option routers 172.22.21.254;
#option domain-name-servers 172.22.21.1;
option subnet-mask 255.255.255.0;
option broadcast-address 172.22.21.255;
option nntp-server 172.22.21.1;
}
###
# Fixed-address
###
# Servers
host iserver {
hardware ethernet 10:9c:dd:4f:91:27;
fixed-address 172.22.21.9;
}
host nature {
hardware ethernet 00:27:bb:6b:c8:4b;
fixed-address 172.22.21.253;
}Configure boot settings for dhcpd
# DHCPD dhcpd_enable="YES" # dhcpd enabled? dhcpd_flags="-q" # command option(s) dhcpd_ifaces="em0" # ethernet interface(s) # If compiled with paranoia support (the default), the following lines are also supported: dhcpd_chuser_enable="YES" # runs w/o privileges? #dhcpd_chroot_enable="YES" # runs chrooted?
Now you should be able to startup your DHCP service
/usr/local/etc/rc.d/isc-dhcpd start




