- Maintained by: Leon
Zero config VPN. Installs on any device in minutes, manages firewall rules for you, and works from anywhere.
-
Auth key from https://login.tailscale.com/admin/authkeys (
tskey-12345...
) -
Enable Linux IP forwarding on Docker Host:
sudo nano /etc/sysctl.conf
Edit value to 1
net.ipv4.ip_forward = 1
Save and exit
Activate the changes
sudo sysctl -p
docker run -d \
--name tailscale-docker-$HOSTNAME \
-h tailscale-docker-$HOSTNAME \
--restart=always \
-v tailscale:/tailscale \
--cap-add=NET_ADMIN \
--network=bridge \
-e "ROUTES=192.168.0.0/24" \
-e "AUTHKEY=tskey-12345..." \
opencsi/tailscale:latest
The bridge network is necessary to give access to the local network.
The tailscale volume saves the tailscale configurations.
The route allows you to access the local network via the vpn. Enter the IP class of your local network. If you have multiple networks: separate the values with a comma (192.168.0.0/24,10.0.0.0/8).
You can also use this container with exit node.
Manage the Tailscale setting from the Admin page.
Run the container in lan to lan tag to connect 2 or more site
Site1 (Lan 192.168.0.0)
docker run -d \
--name tailscale-docker-$HOSTNAME \
-h tailscale-docker-$HOSTNAME \
--restart=always \
-v tailscale:/tailscale \
--cap-add=NET_ADMIN \
--network=bridge \
-e "ROUTES=192.168.0.0/24" \
-e "AUTHKEY=tskey-12345..." \
opencsi/tailscale:stable-LantoLan
Site2 (Lan 192.168.1.0)
docker run -d \
--name tailscale-docker-$HOSTNAME \
-h tailscale-docker-$HOSTNAME \
--restart=always \
-v tailscale:/tailscale \
--cap-add=NET_ADMIN \
--network=bridge \
-e "ROUTES=192.168.1.0/24" \
-e "AUTHKEY=tskey-12345..." \
opencsi/tailscale:stable-LantoLan
Site3 (Lan 192.168.2.0)
docker run -d \
--name tailscale-docker-$HOSTNAME \
-h tailscale-docker-$HOSTNAME \
--restart=always \
-v tailscale:/tailscale \
--cap-add=NET_ADMIN \
--network=bridge \
-e "ROUTES=192.168.2.0/24" \
-e "AUTHKEY=tskey-12345..." \
opencsi/tailscale:stable-LantoLan
In each site enable the route to the docker host running the container.
on site1:
route add <lan site2> mask 255.255.255.0 <IP Docker Host on site1>
route add <lan site3> mask 255.255.255.0 <IP Docker Host on site1>
on site2:
route add <lan site1> mask 255.255.255.0 <IP Docker Host on site2>
route add <lan site3> mask 255.255.255.0 <IP Docker Host on site2>
on site3:
route add <lan site1> mask 255.255.255.0 <IP Docker Host on site3>
route add <lan site2> mask 255.255.255.0 <IP Docker Host on site3>
based of Gruber Dockerfile.