FreeBSD 10.3 : DHCP SERVER

FreeBSD 10.3 : DHCP SERVER:

pkg install isc-dhcp43-server

vi /etc/rc.conf

dhcpd_enable="YES"
dhcpd_conf="/usr/local/etc/dhcpd.conf"
dhcpd_ifaces="if1"
dhcpd_flags="-q"
local1_notice="/var/log/dhcpd.log"

vi /usr/local/etc/dhcpd.conf

# dhcpd.conf
#
option domain-name "msadighian.com";
option domain-name-servers 8.8.8.8, 4.2.2.4;
# 600=10min, 7200=2 hours, 86400=1 day, 604800=1 week, 2592000=30 days
default-lease-time 86400;
max-lease-time 604800;
authoritative;
ddns-update-style none;
log-facility local1;

# A slightly different configuration for an internal subnet.
subnet 10.12.21.0  netmask 255.255.255.0 {
  range 10.12.21.2 10.12.21.254;
  option domain-name-servers 8.8.8.8;
  option routers 10.12.21.1;
  option broadcast-address 10.12.21.255;
  default-lease-time 600;
  max-lease-time 7200;
}
touch /var/log/dhcpd.log

/etc/rc.d/syslogd reload

vi /etc/newsyslog.conf

/var/log/dhcpd.log                       600  3     100  *     B
/usr/local/etc/rc.d/isc-dhcpd start

cat /var/db/dhcpd/dhcpd.leases

By: Mehdi Sadighian
Contact: mehdi.sadighian@hotmail.com
TAG: freebsd 10, freebsd 10.3, DHCP SERVER, DHCP, isc-dhcpd, dhcpd