If this is not a critical production network it's probably ok to just give it a try and see how things work, possibly during off time like on a weekend. Note however that you could end up having to go around to all the client machines and manually renew their leases as described below, or wait a day or more for their leases to time out.
Turn off the dhcp server on your router, and turn on the one on your openbsd box. Watch /var/log/messages
to confirm that clients are requesting and receiving addresses. If you clients are windows machines, you may want to run ipconfig /renew
on them to force them to request a new address from the new server. On linux clients you can run dhclient -r
to do the same thing.
One option to consider is the first time you start the dhcpd on the openbsd box, run it directly via
/usr/sbin/dhcpd -d -f
which causes dhcpd to log in debug mode directly to the console. That can help you spot problems more quickly. After testing dhcpd that way, you hit ^C
to kill it, then relaunch the program in it's normal background mode.
You should consider logging your dhcp messages to a separate file as detailed here - set the dhcpd.conf to log-facility local7, then change your dhcpd.conf as follows:
local7.* /var/log/dhcpd.log
f you do this permanently, remember to modify your newsyslog configuration to rotate this new logfile.
If the router and new server are on the same network, disabling the router dhcp server and enabling the server dhcpd will automatically work.
Configuring the server to get it's IP address from the dhcp daemon doesn't really make sense, because you run into a chicken and egg problem. Instead, you use the range
keyword to dispense addresses on the same network as your server. For example, assume your server is 192.168.0.1 on a class C network, you put something like this in your dhcpd.conf:
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.5 192.168.0.254;
option routers 192.168.0.1;
}
That says give out addresses between 192.168.0.5 and 192.168.0.254 (inclusive). Your router is manually configured at 192.168.0.1, and you leave a few additional static addresses (.2 through .4) in case you might have some other devices to attach later.
Finally, for testing this it is helpful to set the lease timeouts to a much shorter than usual time. In a static environment, you might want your max-lease-time and default-lease-time to be set to several days or a week. For this cutover, see if you can drop those values much lower on your existing router, and also set them to lower values (an hour perhaps?) on your new openbsd dhcp server. That will help you cut down on the amount of manual renewals you have to do on client machines if you decide to switch back to the old dhcp server. Once you have everything running smoothly with the new server, bump these values back up to larger numbers to avoid unnecessary dhcp traffic on your network.