Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been setting up a DHCP server in OpenBsd and I think I now have it configured correctly. However I have a couple of questions.

  1. How can I check that it is working properly before I give it control?
  2. Once I have switched off dhcp in the router how do I know that the server will take control and respond ect?
  3. How should I configure the server to give it self an ip address from the the dhcp daemon?

Please ignore my ignorance. Thanks in advance.

share|improve this question

2 Answers 2

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.

share|improve this answer

Also, the dhcpclient on the BSD's gives a lot more detail than the windows one (maybe there's a switch I don't know about?), so if needed, get a *BSD liveCD to know which DHCP server is dishing out the numbers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.