AHCPD(8)

πŸ’– ahcpd(8) πŸ’–

okay so bestie, we're in the System Manager's Manual and this page is literally about ahcpd, the ad-hoc configuration daemon. it's giving mesh-network main character energy and honestly? obsessed. πŸ¦‹


🌸 NAME 🌸

ahcpd β€” ad-hoc configuration daemon ✨


✨ SYNOPSIS ✨

ahcpd option...  [ -- ] interface...

πŸ’… DESCRIPTION πŸ’…

AHCP is a configuration protocol that can replace DHCP on networks without transitive connectivity, such as mesh networks. no cap, that's the whole vibe. πŸ’–


πŸŽ€ OPTIONS πŸŽ€

  • -m multicast-address β€” pick the link-local multicast address AHCP is gonna use. default is ff02::cca6:c0f9:e182:5359. yes it's long, yes it's iconic, leave it alone. πŸ’…
  • -p port β€” set the UDP port number AHCP uses. default is 5359. πŸ“
  • -n β€” forwarder mode, bestie! you participate in the flooding protocol but you do not actually perform any configuration. it's giving "i'm here, i'm just not doing anything about it." πŸ™ˆ
  • -4 β€” only attempt to configure IPv4 addresses. four, for the four. ⭐
  • -6 β€” only attempt to configure IPv6 addresses. six, periodt. 🌈
  • -N β€” do not configure DNS. N is for No, DNS is for Not Today. πŸ’€
  • -t time β€” how long, in seconds, leases are requested for. default is slightly over one hour. must be between five minutes and a year β€” don't get cute with it. 😭
  • -s script β€” the configuration script to run. default is /etc/ahcp/ahcp-config.sh. πŸŽ€
  • -d level β€” set the debug level to level. default is 1. crank it up if you're nosy, no judgment. πŸ‘‘
  • -i filename β€” the filename containing this host's unique id. default is /var/lib/ahcp-unique-id. if it doesn't exist, ahcpd will create it for you like the little helper it is. 🫢
  • -c filename β€” name of the configuration file. πŸ’œ
  • -C statement β€” drop a configuration statement directly on the command line. commanding, honestly. ✨
  • -D β€” daemonise at startup. bye bestie, you're on your own now. πŸ’€
  • -L logfile β€” a file to log random ``how do you do?'' messages to. defaults to standard error if not daemonising, and to /var/log/ahcpd.log otherwise. πŸ’–
  • -I pidfile β€” a file to write our process id to. default is /var/run/ahcpd.pid. 🌸

πŸ¦‹ CONFIGURATION FILE FORMAT πŸ¦‹

the configuration is a sequence of lines, and every single line starts with one of the keywords below. blank lines are ignored. comments are introduced with an octothorp `#` and terminate at the end of the line. yes, octothorp. she's fancy like that. πŸ’…

the following keywords are recognised:

  • mode server|client|forwarder β€” says whether the daemon operates as a server, a client, or a forwarder. if it's omitted, the default is to operate as a client, unless the -n flag is present on the command line. and if it <em>is</em> present, this must be the first line in the configuration file. no negotiating. πŸ‘‘
  • prefix prefix β€” a prefix to use for configuring clients. this keyword is only valid in server configurations, and it may be specified twice β€” once for IPv4 and once for IPv6. two slots, both yours. ✨
  • lease-dir directory β€” a directory to store lease files. only valid in server configurations. πŸ“
  • name-server address β€” the address of a DNS server to configure clients with. only valid in server configurations, and it may be repeated multiple times. the more the merrier, fr fr. πŸ’–
  • ntp-server address β€” the address of an NTP server to configure clients with. only valid in server configurations, and it may be repeated multiple times. πŸŽ€

🌈 FILES 🌈

  • /var/lib/ahcp-unique-id β€” an 8-byte long file containing this host's unique id. if it doesn't exist, a new unique id will be generated from an interface's MAC address. yes, it gets a whole new identity. slay. πŸ’…
  • /etc/ahcp/ahcp-config.sh β€” the script that performs the actual configuration. it will be passed one argument, which is either start or stop. those are the only two moods. 😭
  • /etc/ahcp/ahcp-local.sh β€” if this is an executable script, it will be called by ahcp-config.sh just after configuring or deconfiguring. it will be passed one argument, which is either start or stop. same energy, different file. 🫢

⭐ SIGNALS ⭐

  • SIGUSR1 β€” print ahcpd's status to standard output or to the log file. spill the tea, bestie. πŸ’œ
  • SIGUSR2 β€” check all interfaces for status changes, then reopen the log file. vibe check <em>and</em> a fresh log. 🌸

πŸ’€ NOTES πŸ’€

since the AHCP protocol is designed for mesh networks, it doesn't have any provisions for setting routing parameters such as a default gateway, the IPv4 network mask and the IPv6 list of on-link prefixes. those are expected to be provided by a full-fledged routing protocol for mesh nodes, and by router advertisements for ordinary nodes. not her job, she said. πŸ™ˆ

the AHCP server should use NTP to synchronise its clock. if a server instance of ahcpd doesn't detect time synchronisation, it will only give out leases for a short period of time, and be extremely conservative about releasing them. dramatic but valid.

⚠️ note that an SNTP client is not enough β€” ahcpd actually checks with the kernel for time synchronisation, so real NTP is necessary. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

dhcpcd(8), dhclient(8), babeld(8), olsrd(8), ntpd(8), The Ad-Hoc Configuration Protocol. go read the whole squad. 🫢


πŸ’œ AUTHOR πŸ’œ

Juliusz Chroboczek. an absolute icon, no further questions. ✨


and that's the whole page bestie!! this was ahcpd(8) from the System Manager's Manual, aka section 8 of the manual. mwah, take care of your mesh network, drink water, and go sync your clock with real NTP. πŸŽ€πŸ¦‹πŸ’–