Tailscale Setup Guide¶
A guide for installing and configuring Tailscale as a mesh VPN, including subnet routing, exit nodes, and Docker integration.
Installation¶
Basic Setup¶
Start Tailscale¶
Check Status¶
Authenticate¶
Follow the printed URL to authenticate the device in the Tailscale admin console at https://login.tailscale.com.
Subnet Router¶
Advertise local network routes so other Tailscale nodes can reach devices on this network.
Enable IP Forwarding¶
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
Advertise Routes¶
Important: After advertising routes, approve them in the Tailscale admin console under the machine's route settings.
Exit Node¶
Allow other Tailscale devices to route all internet traffic through this machine.
Approve the exit node in the Tailscale admin console.
Use an Exit Node (Client Side)¶
UDP GRO Forwarding (Performance)¶
Optimize network performance for forwarding:
NETDEV=$(ip route show 0/0 | awk 'NR==1 {print $5}')
sudo ethtool -K $NETDEV rx-udp-gro-forwarding on
Make Persistent via NetworkD Dispatcher¶
cat << 'EOF' | sudo tee /etc/networkd-dispatcher/routable.d/50-tailscale
#!/bin/sh
NETDEV=$(ip route show 0/0 | awk 'NR==1 {print $5}')
ethtool -K $NETDEV rx-udp-gro-forwarding on rx-gro off
EOF
sudo chmod 755 /etc/networkd-dispatcher/routable.d/50-tailscale
Docker + Tailscale Integration¶
Problem: Stateful Filtering Warning¶
When running Docker alongside Tailscale, you may see:
Warning: Stateful filtering is enabled and Docker was detected;
this may prevent Docker containers on this host from connecting to Tailscale nodes.
Solution 1: IPTables Rules (Recommended)¶
sudo iptables -I DOCKER-USER -i tailscale0 -j ACCEPT
sudo iptables -I DOCKER-USER -o tailscale0 -j ACCEPT
sudo iptables -A FORWARD -i docker0 -o tailscale0 -j ACCEPT
sudo iptables -A FORWARD -i tailscale0 -o docker0 -j ACCEPT
# Save rules persistently
sudo apt install -y iptables-persistent
sudo iptables-save | sudo tee /etc/iptables/rules.v4
Solution 2: Docker Daemon Configuration¶
Edit /etc/docker/daemon.json:
Warning: Disabling Docker's iptables management means you lose Docker's built-in network isolation. Use Solution 1 unless you have specific reasons.
Auto-Update¶
Troubleshooting¶
Restart Tailscale¶
Check Daemon Logs¶
Subnet Routing Issues¶
If subnet routes are not working:
-
Verify IP forwarding is enabled:
-
Verify routes are approved in admin console
-
Try with explicit flags:
Docker Not Restarting¶
If Docker fails to restart after editing daemon.json: