How to install ‘dhcpd’ on FreeNAS 9.1.1

You can run a DHCP server on your FreeNAS installation through the following steps:

  • Log in as root through SSH on your server:
  • $ ssh root@192.168.1.100

  • Remount the root file system with write permissions:
  • # mount / -uw

  • Install the current package (added in 2014) for the DHCP server:
  • # pkg_add -r isc-dhcp43-server

  • Copy the DCHP executable to the following directory:
  • # cp /etc/local/rc.d/isc-dhcpd /conf/base/etc/local/rc.d/

  • Create the configuration file for the DHCP server in e.g your home directory and copy it to the following directory:
  • # cp /home/$USER/dhcpd.conf /conf/base/etc/local/

  • You can now reboot your NAS in order to mount the root file system read-only again. After the successful boot log into your NAS once again as root and create a database for the client leases:
  • # touch /var/db/dhcpd.leases

  • Finally start the DHCP server with:
  • # dhcpd

These two last steps have to be done after every reboot but since a NAS is always online it shouldn’t hurt. If you didn’t encounter any problems you can now assign a static IP to your NAS either via the web interface or through SSH:

# ifconfig re0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255