avahi-autoipd
Assign a link-local IP address automatically
SYNOPSIS
avahi-autoipd [OPTION...] INTERFACE
PARAMETERS
-D or --daemonize
Runs the daemon in the background. It detaches from the controlling terminal.
-p PATH or --pid-file=PATH
Specifies a custom path for the PID file. By default, it uses /var/run/avahi-autoipd.
-r or --run-once
Exits after configuring the interface with the first valid IPv4 Link-Local address, or after a DHCP lease is obtained, instead of running continuously.
-s or --syslog
Logs messages to syslog instead of standard error.
-t or --test
Enables test mode. The daemon performs its operations but does not actually assign an IP address to the interface.
-w or --wait
Waits indefinitely until an IP address is assigned (either via DHCP or Link-Local) or until the specified interface becomes available.
--no-chroot
Disables the chroot() operation, which is normally performed for security reasons.
--no-drop-root
Disables dropping root privileges. Normally, the daemon drops privileges after initializing.
-h or --help
Displays a help message and exits.
-v or --version
Displays version information and exits.
DESCRIPTION
avahi-autoipd is a daemon that automatically assigns a unique IPv4 Link-Local address (from the 169.254.0.0/16 range) to a specified network interface. This process is often referred to as APIPA (Automatic Private IP Addressing) or Zeroconf (Zero Configuration Networking) IP address assignment. Its primary function is to ensure that a device can obtain an IP address even in the absence of a DHCP server, allowing basic network communication within the local subnet.
The daemon first attempts to obtain an IP address via DHCP. If a DHCP lease is successfully acquired, avahi-autoipd exits, as its service is no longer needed. If DHCP fails or is unavailable, it then proceeds to select an address from the Link-Local range and performs ARP (Address Resolution Protocol) probing to ensure the chosen address is not already in use by another device on the network. Once a unique address is confirmed, it configures the interface with that address.
avahi-autoipd is an integral part of the Avahi project, which provides a free and open-source implementation of Apple's Bonjour (Zeroconf) protocol suite for Linux and other Unix-like operating systems. It enables services to be advertised and discovered on a local network without manual configuration, relying on protocols like mDNS (multicast DNS) and DNS-SD (DNS Service Discovery).
CAVEATS
avahi-autoipd typically requires root privileges to configure network interfaces. It is often invoked by network management scripts (e.g., from systemd-networkd, NetworkManager, or traditional init scripts) rather than directly by end-users. Running multiple IP address assignment services (like another DHCP client or static configuration) concurrently on the same interface might lead to conflicts.
The daemon executes a script located at /etc/avahi/autoipd.action upon certain events (like address assignment or conflicts), which can be customized by the system administrator.
ACTION SCRIPT
Upon events like acquiring a Link-Local address, detecting a conflict, or losing an address, avahi-autoipd executes the script /etc/avahi/autoipd.action. This script receives environment variables detailing the event and the assigned address. Administrators can customize this script to perform additional actions, such as updating firewall rules, notifying other services, or executing custom commands based on the network state changes.
INTEGRATION WITH NETWORK MANAGERS
On modern Linux distributions, avahi-autoipd is frequently integrated with system-level network configuration tools like NetworkManager or systemd-networkd. These tools can automatically start avahi-autoipd for interfaces configured to use Link-Local IP addresses as a fallback, ensuring seamless network connectivity even in challenging environments.
HISTORY
avahi-autoipd is part of the Avahi project, which was started around 2005 by Lennart Poettering and Trent Lloyd. Avahi aimed to provide a comprehensive and free implementation of Apple's Zeroconf (Bonjour) protocols for Linux and other Unix-like systems. This included mDNS (multicast DNS) for hostname resolution and DNS-SD (DNS Service Discovery) for discovering services on a local network. avahi-autoipd was developed as a crucial component to ensure that even without a DHCP server, devices could self-configure an IP address, thus providing the foundational network connectivity required for Zeroconf services to function.
SEE ALSO
avahi-daemon(8), avahi-browse(1), avahi-discover(1), dhclient(8), ip(8), systemd-networkd(8)