You can run a DHCP server on your FreeNAS installation through the following steps:
- Log in as root through SSH on your server:
- Remount the root file system with write permissions:
- Install the current package (added in 2014) for the DHCP server:
- Copy the DCHP executable to the following directory:
- Create the configuration file for the DHCP server in e.g your home directory and copy it to the following directory:
- 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:
- Finally start the DHCP server with:
$ ssh root@192.168.1.100
# mount / -uw
# pkg_add -r isc-dhcp43-server
# cp /etc/local/rc.d/isc-dhcpd /conf/base/etc/local/rc.d/
# cp /home/$USER/dhcpd.conf /conf/base/etc/local/
# touch /var/db/dhcpd.leases
# 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