I am migrating a bunch of services from my Synology to OpenBSD ; DHCP Server being one of them. I have configured quite a few DHCP reservations over time. And I would like a better way to migrate them to dhcpd(8) than copy & paste ; or rewrite from scratch.
By default, a DHCP client gets an IP address, a network gateway and a DNS server. That’s fine most of the time. But if you own an OpenBSD cloud instance that has to use DHCP to get online, you might not be satisfied with the domain-name-servers option provided by your DHCP server. Hopefully, OpenBSD provides an easy way to force your DNS:
# vi /etc/dhclient.conf (...) prepend domain-name-servers 127.0.0.1;
Since then, OpenBSD will use our DNS resolver. Which is… unbound(8)
# rcctl enable unbound # rcctl start unbound
Note that this configuration allows to use the DNS server provided by the DHCP server as a fallback.
Switching from DHCP to static IP on a Debian system requires only a few steps:
# /etc/init.d/networking stop # vi /etc/network/interfaces (...) allow-hotplug eth0 #iface eth0 inet dhcp iface eth0 inet static address 192.168.0.62 netmask 255.255.255.0 gateway 192.168.0.1 broadcast 192.168.0.255 network 192.168.0.0 (...) # reboot
That’s All Folks!
OpenBSD is really easy to install.
It’s not shinning, but it asks for a few questions and only takes a couple of minutes to get a working system.