In this guide, I will demonstrate how to use the robust and secure OpenBSD to set up a DHCP server.
Recently I had the need to configure a DHCP server for a Wi-Fi guest network, and OpenBSD is the ideal solution for this task. It's a lightweight, highly secure, and stable choice.
Note: For reference, there is an example file, /etc/examples/dhcpd.conf, available on the system.
# $OpenBSD: dhcpd.conf,v 1.1 2014/07/11 21:20:10 deraadt Exp $
#
# DHCP server options.
# See dhcpd.conf(5) and dhcpd(8) for more information.
#
option domain-name "wifiguest.std.rocks";
option domain-name-servers 8.8.8.8, 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
range 192.168.1.20 192.168.1.200;
#if needed to specify static address
#host static-client {
# hardware ethernet 11:11:11:aa:aa:aa;
# fixed-address 192.168.1.30;
#}
}
OpenBSD# rcctl enable dhcpd
OpenBSD# rcctl start dhcpd
OpenBSD# rcctl check dhcpd
OpenBSD# cat /var/db/dhcpd.leases
lease 192.168.1.20 {
starts 3 2023/11/01 14:15:24 UTC;
ends 4 2023/11/02 02:15:24 UTC;
hardware ethernet 63:a0:03:59:23:b3;
uid 01:63:a0:03:59:23:b3;
}
Contact :