Service bound to a Tailscale IP fails at boot: cannot assign requested address
Why a service listening on your 100.x Tailscale address fails at boot even after tailscaled, and the two-line fix with tailscale-online.target.
“Cannot assign requested address” at boot means the service tried to listen on your 100.x.y.z Tailscale address before the machine had it. After=tailscaled.service does not help, because tailscaled tells systemd it is ready before the address is on the interface. Since version 1.96.5 (March 2026), Tailscale’s Linux packages ship tailscale-online.target, which is reached only once the address is there. Order the service after it and pull it in: run sudo systemctl edit <service> and add two lines:
[Unit]
Wants=tailscale-online.target
After=tailscale-online.targetCopiedWhy tailscaled being up is not enough
The error is the kernel’s EADDRNOTAVAIL, which bind(2) describes as “A nonexistent interface was requested or the requested address was not local.” Each program puts its own words in front of it; in a Docker daemon’s log it reads “bind: cannot assign requested address”. Started by hand once the machine is up, the same service works, which is what makes it look random.
Tailscale’s issue #11504, open from March 2024 to February 2026, records the cause: tailscaled reports itself ready to systemd before its address can be bound, so everything ordered After=tailscaled.service starts in a window when tailscale0 has no address. A service listening on 127.0.0.1 or 0.0.0.0 never notices; one given the Tailscale address, which is the usual way to keep an agent’s gateway or dashboard off the public internet, fails on every reboot that loses the race. To confirm it is this and not a wrong address, compare the boot’s log with what the interface holds now:
journalctl -b -u nginx.service | grep -i 'assign requested'
ip -br addr show tailscale0CopiedIf the address in the error is the one tailscale0 shows, the order is the problem. If it is not, the service is configured with an old or mistyped address, and no ordering will fix that.
Check your Tailscale has the target
The units came in two steps. tailscale wait, which blocks until the interface holds a Tailscale address, is in the changelog for 1.96.2 (March 18, 2026). The tailscale-online.target and tailscale-wait-online.service that run it were left out of the 1.96.2 packages, as users pointed out on the issue, and were added to the deb, rpm and tarball packaging by PR #19078; the first tag whose packaging includes them is v1.96.5, released March 30, 2026. On the server:
tailscale version
systemctl cat tailscale-online.targetCopied“No files found” from the second command means the installed package predates them, or came from somewhere other than Tailscale’s own repository; update from Tailscale’s repository, or use tailscale wait directly, below.
The two units, as they read in Tailscale’s source:
# tailscale-online.target
[Unit]
Description=Tailscale is online
Requires=tailscale-wait-online.service
After=tailscale-wait-online.service
# tailscale-wait-online.service
[Unit]
Description=Wait for Tailscale to be online
After=tailscaled.service
Requires=tailscaled.service
[Service]
Type=oneshot
ExecStart=/usr/bin/tailscale wait
RemainAfterExit=yes
[Install]
WantedBy=tailscale-online.targetCopiedThe target has no [Install] section, so nothing enables it at boot: it is reached only when a unit asks for it, and asking for it brings the wait service along. That is why your drop-in needs both lines. In systemd, ordering and requirement are independent of each other: After= alone orders the service behind a target nobody started, and Wants= alone starts the wait without making the service wait for it. It is the same pairing systemd asks for with network-online.target.
The drop-in, for the services that usually hit this
sudo systemctl edit <unit> opens an override file and reloads systemd when you save; the lines go under a [Unit] header. The unit to edit is the one that opens the listening socket:
- An agent’s gateway or a dev server run as a system service: its own unit, the name in
systemctl list-units --type=service. - A Docker container whose port is published on the Tailscale address (
-p 100.x.y.z:8080:80):docker.service, since the Docker daemon is what starts the containers at boot. A forum report from 2023 showsAfter=tailscaled.servicealone failing here for exactly the reason above. - sshd with a
ListenAddressof100.x.y.z: the SSH unit. Ifss -tlnpnamessystemdas the process holding port 22, a socket unit owns the listener and that is the unit to edit. Before limiting sshd to the tailnet this way, have a way in that does not depend on it: a server reached only over Tailscale is set up in the Tailscale SSH guide. - nginx, Caddy or another proxy with a
listen 100.x.y.z:443line: its service unit.
Then reboot, since restarting the service by hand proves nothing about boot order, and check that it came up:
systemctl status tailscale-wait-online.service nginx.service
systemd-analyze critical-chain nginx.serviceCopiedThe second command shows the service starting after tailscale-online.target.
When Tailscale never comes up
tailscale wait has no time limit by default (its --timeout defaults to 0, “wait indefinitely”), and systemd gives a Type=oneshot service no start timeout by default either. So on a server that is logged out of Tailscale, or whose node key has expired, the wait does not end, and neither does the wait of every service ordered after the target. That is usually what you want for a service whose only address is the tailnet one, which could not listen anyway. Turning off key expiry for the server, as the Tailscale SSH guide describes, removes the most common way for it to happen months later. If you would rather the wait gave up, override the wait service with sudo systemctl edit tailscale-wait-online.service:
[Service]
ExecStart=
ExecStart=/usr/bin/tailscale wait --timeout=120sCopiedThe empty ExecStart= clears the packaged command before the new one replaces it. With Wants= your service then starts after the timeout and fails on the address as before; with Requires= in its place, it is not started at all.
User services and scripts: tailscale wait
A service in your own account’s service manager (systemctl --user), which is how several agents install their gateway, belongs to a different service manager from the system’s targets, and the user-service guide covers keeping it running at all. For it, or for anything started by a script, Tailscale’s CLI reference gives the plain form: tailscale wait && /path/to/service. In a unit, the same thing is a line before the start:
[Service]
ExecStartPre=/usr/bin/tailscale wait
ExecStart=/path/to/your-gateway --host 100.x.y.zCopiedtailscale wait returns once the backend is running and an interface holds the node’s first Tailscale address, and exits 0. To wait for one particular address, the reference pairs it with tailscale ip --assert=<address>, which fails unless the node has that address. This replaces the loops polling ip addr or tailscale status that circulated as workarounds on the issue before the command existed.
Restart=on-failure is the other common suggestion, and with systemd’s defaults it tends not to last long enough: a restart comes 100 ms after the failure, and a unit gets five starts in ten seconds before systemd stops trying, so the attempts can be spent in under a second, well before a slow Tailscale connection finishes.
Other ways round it, and what each costs
- Listen on
127.0.0.1and let Tailscale Serve carry it. The service never binds the tailnet address, so there is nothing to race.tailscale serve --bg 8080publishes it on the machine’s tailnet name over HTTPS, and according to the Serve CLI reference, with--bg“Serve automatically resumes sharing” after a reboot;tailscale serve --tcp=<port> tcp://localhost:<local-port>does the same for a non-HTTP port. It needs HTTPS certificates enabled for the tailnet, and the app sees requests coming from the local proxy. Setting it up is in opening a server’s localhost app from your laptop. - Listen on
0.0.0.0and firewall the public side. The service starts whatever Tailscale is doing, and the firewall decides who reaches it. The cost is that the service’s exposure now rests on the firewall rule, and Docker’s published ports go round ufw; checking open ports on Linux covers reading what actually listens where. - Let the kernel accept the bind early.
net.ipv4.ip_nonlocal_bind=1(andnet.ipv6.ip_nonlocal_bind=1for the IPv6 address) lets a program bind an address the machine does not hold yet, so the service starts and answers once Tailscale brings the address up. It is off by default, applies to every program on the machine, and the kernel documentation says of it only that it “can be quite useful - but may break some applications.” It also lets a mistyped address bind without complaint, so the mistake shows up as a service nobody can reach rather than as an error at start.