{"id":59,"date":"2024-06-22T10:19:22","date_gmt":"2024-06-22T06:19:22","guid":{"rendered":"https:\/\/www.kerloys.com\/?p=59"},"modified":"2024-06-22T10:19:22","modified_gmt":"2024-06-22T06:19:22","slug":"tailscale-on-firewalla-using-docker","status":"publish","type":"post","link":"https:\/\/www.kerloys.com\/index.php\/2024\/06\/22\/tailscale-on-firewalla-using-docker\/","title":{"rendered":"Tailscale on Firewalla using Docker"},"content":{"rendered":"\n<p>In this article, you will learn how to set up Tailscale on a Firewalla device using Docker. We&#8217;ll guide you through creating necessary directories, setting up a Docker Compose file, starting the Tailscale container, and configuring it to auto-start on reboot. This setup will ensure a secure and stable connection using Tailscale&#8217;s VPN capabilities on your Firewalla device.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Prepare Directories<\/h3>\n\n\n\n<p>Create the necessary directories for Docker and Tailscale:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-5dc1fa00fa0ff3958dbfccfa33a63bdb\"><code>mkdir -p \/home\/pi\/.firewalla\/run\/docker\/tailscale\ncd \/home\/pi\/.firewalla\/run\/docker\/tailscale\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Create Docker Compose File<\/h3>\n\n\n\n<p>Create and populate the <code>docker-compose.yml<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-4d7ddacd67125c0c04a7e08314719271\"><code>cat &gt; docker-compose.yml &lt;&lt; EOF\nversion: \"3\"\nservices:\n  tailscale:\n    image: tailscale\/tailscale:stable\n    container_name: firewalla-tailscale\n    deploy:\n      restart_policy:\n        condition: on-failure\n        max_attempts: 3\n    network_mode: \"host\"\n    volumes:\n      - \"\/home\/pi\/.firewalla\/run\/docker\/tailscale:\/var\/lib\"\n      - \"\/dev\/net\/tun:\/dev\/net\/tun\"\n    privileged: true\n    cap_add:\n      - net_admin\n      - sys_module\n    command: tailscaled\nEOF\n<\/code><\/pre>\n\n\n\n<p>In this configuration, the image tag <code>stable<\/code> ensures a stable version of Tailscale is used.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Start the Container<\/h3>\n\n\n\n<p>Start Docker and the Tailscale container:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-9d12a463870d353d6d4419e93e47f5cd\"><code>sudo systemctl start docker\nsudo docker-compose up -d\nsudo docker exec firewalla-tailscale tailscale up --advertise-routes=192.168.1.0\/24 --advertise-exit-node\nsudo docker exec firewalla-tailscale tailscale status\n<\/code><\/pre>\n\n\n\n<p>Follow the printed instructions to authorize the node and routes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Auto-Start on Reboot<\/h3>\n\n\n\n<p>Ensure Docker and Tailscale start on reboot by creating the following script:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-fba932f38d59529bafef0e2fdd046c94\"><code>mkdir -p \/home\/pi\/.firewalla\/config\/post_main.d\/\ncd \/home\/pi\/.firewalla\/config\/post_main.d\/\ncat &gt; start_tailscale.sh &lt;&lt;EOF\n#!\/bin\/bash\n\necho \"\\$0 - \\$(date \"+%Y-%m-%d - %H:%M:%S\") - starting docker\"\nsudo systemctl start docker\nsleep 60\ncd \/home\/pi\/.firewalla\/run\/docker\/tailscale\n\necho \"\\$0 - \\$(date \"+%Y-%m-%d - %H:%M:%S\") - pulling latest images\"\nsudo docker-compose pull\n\necho \"\\$0 - \\$(date \"+%Y-%m-%d - %H:%M:%S\") - bringing containers up\"\nsudo docker-compose up -d\nsleep 60\n\necho \"\\$0 - \\$(date \"+%Y-%m-%d - %H:%M:%S\") - starting tailscale\"\nsudo docker exec firewalla-tailscale tailscale up --advertise-routes=192.168.1.0\/24 --advertise-exit-node\nsleep 15\n\necho \"\\$0 - \\$(date \"+%Y-%m-%d - %H:%M:%S\") - checking status\"\nsudo docker exec firewalla-tailscale tailscale status\n\necho \"\\$0 - \\$(date \"+%Y-%m-%d - %H:%M:%S\") - pruning images\"\nsudo docker system prune -f\nEOF\n<\/code><\/pre>\n\n\n\n<p>Make the script executable:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-5175294ba0168d833d6d57ec9fb7724f\"><code>chmod +x start_tailscale.sh\n<\/code><\/pre>\n\n\n\n<p>With these steps, you should have Tailscale running on Firewalla using Docker. Adjust the <code>advertise-routes<\/code> command as needed for your network configuration.<\/p>\n\n\n\n<p>For additional details and troubleshooting, refer to the original <a href=\"https:\/\/help.firewalla.com\/hc\/en-us\/community\/posts\/13834287150227-Running-Tailscale-on-Docker-working-except-advertise-routes\">Firewalla community post<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn how to set up Tailscale on a Firewalla device using Docker. We&#8217;ll guide you through creating necessary directories, setting up a Docker Compose file, starting the Tailscale container, and configuring it to auto-start on reboot. This setup will ensure a secure and stable connection using Tailscale&#8217;s VPN capabilities on &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.kerloys.com\/index.php\/2024\/06\/22\/tailscale-on-firewalla-using-docker\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Tailscale on Firewalla using Docker&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-technology-networking"],"_links":{"self":[{"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":1,"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":60,"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/posts\/59\/revisions\/60"}],"wp:attachment":[{"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kerloys.com\/index.php\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}