# dhcpd returns error when setting up sync: Can't find service "dhcpd-sync" in /etc/services



## rowan194 (Oct 18, 2021)

Hi all,

I'm attempting to set up two DHCP servers and sync them. dhcpd has been working fine for years, but now that I add the extra sync options, the following error occurs:

`dhcpd -c /usr/local/etc/dhcpd.conf -Y em0 -y em0`

dhcpd: Can't find service "dhcpd-sync" in /etc/services

Obviously, the entry for "dhcpd-sync" does not exist in /etc/services, but it's also absent from the official IANA registry ( https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml )

Web search results are mostly about the feature being added to various dists, or the source code. I did find one page specifically for the dhcpd-sync term that suggests using port 8067, but that's allocated by IANA to infi-async, which doesn't sound right.

This feature seems to have been in dhcpd since at least 2008, so it's not bleeding edge brand new code. Has the feature (or the dhcpd-sync services listing) been deprecated?

Version is dhcpd-6.6.20200413 (most recent) from packages. Thanks.


----------



## SirDice (Oct 18, 2021)

You could use a "private port" (49152-65535), those are, by definition, undefined. It really doesn't matter which port you pick, as long as both nodes use the same port. Although IANA designated port 80 for HTTP there's nothing stopping you from running your webserver on port 81 for example. The same principle applies here.





__





						Service Name and Transport Protocol Port Number Registry
					





					www.iana.org


----------



## rowan194 (Oct 18, 2021)

I understand I can assign an arbitrary port, but I'd prefer to stick with something official/conventional wherever possible, something that won't break if I inadvertently "restore" the default /etc/services in the future. It wouldn't be such an issue if I could override the /etc/services check and directly specify the port number.

Perhaps OpenBSD used 8067 when adding the code to dhcpd, but never officially registered that use with IANA.

(Should the FreeBSD package install the /etc/services entry, or at least warn that syncing won't work by default?)


----------



## SirDice (Oct 18, 2021)

rowan194 said:


> I understand I can assign an arbitrary port, but I'd prefer to stick with something official/conventional wherever possible, something that won't break if I inadvertently "restore" the default /etc/services in the future.


Just put the numerical port number in the configuration, no need to edit /etc/services.


----------



## rowan194 (Oct 18, 2021)

SirDice said:


> Just put the numerical port number in the configuration, no need to edit /etc/services.


Where? I can't find any mention of 'port' or 'sync' within the dhcpd.conf man page. The man page for dhcpd (in the section "SYNCHRONISATION") seems to suggest it's a commandline option only, and in this instance the colon is used to specify the multicast TTL value, rather than a port. A quick browse of the code also suggests that sync_port is only set in one place, with a call to getservbyname("dhcpd-sync", "udp")


----------



## SirDice (Oct 18, 2021)

Don't use net/dhcpd myself and the dhcpd.conf(5) manual page defaults to showing the net/isc-dhcp44-server man pages that have the same name.


----------

