Monday, March 31, 2014

Custom DHCP server configuration on Opengear

For the last few years I've run my home DHCP service on a virtual private server at AWS.

This was not a great idea. It's a pain to resolve issues with my Internet service when those issues cause my laptop to stop getting an IP address assigned because the path between my house and the DHCP server has been interrupted.

The service is at Amazon because I wanted to purge "server" like things from the house, but its clear that I needed to bring DHCPd back home. I started investigating moving the service to one of my Opengear ACM5000 units, which is always running anyway because it keeps tabs on my generator and home security system, sends me text messages about interesting events and whatnot.

The Opengear web UI doesn't offer too many DHCP service configuration options, but I didn't expect that to be a problem. One of the things I love about Opengear is that most anywhere you look, the baked-in scripts and configuration elements can be replaced with user-supplied versions of those things.

I'd expected to find something like include /etc/config/dhcpd-user.conf in the automagically-generated DHCPd configuration, but it wasn't there.

So, I strings-ed every file in the devkit, and found this gem:

chris@opengeardev:/usr/local/src$ strings OpenGear-ACM500x-devkit-20140225/lib/libconfig.so | grep dhcpd-custom
/etc/config/dhcpd-custom.conf

 It isn't documented anywhere (that I could find), so I pinged @opengeardev on twitter to ask about it.

3 minutes later, @opengeardev replied, having reviewed the code.

I've tried reaching other vendors in this space about real problems
on real (paid-for) products and gotten nowhere fast, even on their
(paid-for) support lines. Memo to JGV, ZEI and Ynagebavk (ROT13):
Try to be more like Opengear.
All I needed to do was:
  1. Create my intended dhcp server configuration as /etc/config/dhcpd-custom.conf
  2. Enable the service with the checkbox in the web UI
  3. Maybe run the configurator by hand with config -r dhcp (probably hitting 'apply' after ticking the box does this anyway)
My new DHCP server configuration is now enshrined in the configuration bundle (backups from the web UI will save it), and the service is running with my particular configuration requirements, but without me having to butcher the service to get it running this way.

# ps | grep dhcpd     
 2993 root      3632 S    /bin/dhcpd -f -cf /etc/config/dhcpd-custom.conf -lf /
 3047 root      1228 S    grep dhcpd 
#                

I love Opengear. Not only did they anticipate my requirement, but they're super-responsive to customer queries. Or, I assume they are. I'm not really a customer. The boxes I own were freebies, but those gifts haven't influenced my opinions about the company. I love Opengear because their products and their people are the best, not because they gave me some hardware to play with.