Setting up a DHCP Server for your home or company network is pretty simple with NetBSD. You don't need to install any software, because everything you need, is part of the base system. Just create the file /etc/dhcpd.conf like this:

deny unknown-clients;       
ddns-update-style none;      
subnet netmask {
        default-lease-time 28800;
        max-lease-time 86400;
        option broadcast-address;
        option domain-name "";
        option domain-name-servers,;
        option routers;

        host ftp-server {
                hardware ethernet 00:00:0a:d8:39:ee;
        host sparc {
                hardware ethernet 00:50:04:01:ee:20;

Now add the service to your /etc/rc.conf. This way the DHCP will be started on every reboot.

dhcpd_flags="-q ex0"

ex0 is the Network Interface to listen on for dhcp requests. This is important if you have more than one Network Interface. If you don't, you can omit the second line.

Before starting the service, you have to create a lease file, that the dhcp server needs.

# touch /var/db/dhcpd.leases

Now start the service:

# /etc/rc.d/dhcpd start

To test if your dhcp server is running, run dhclient on another host on the same network.

# dhclient

Also check your /var/db/dhcpd.leases file. That's it. Have fun.

Additional Information

Add a comment