• Stars
    star
    362
  • Rank 117,671 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run Tailscale on your Unifi Dream Machine

Tailscale on Unifi Dream Machine

This repo contains the scripts necessary to install and run a tailscale instance on your Unifi Dream Machine (UDM/UDM Pro/UDR/UDM-SE). It does so by piggy-backing on the excellent boostchicken/udm-utilities to provide a persistent service and runs using Tailscale's usermode networking feature.

UniFi OS 2.x/3.x

β“˜ You can confirm your OS version by running /usr/bin/ubnt-device-info firmware_detail

NOTE: UniFi OS 2.x+ support is currently in beta for this project, if you encounter any issues please open an issue and we'll do our best to help you out. Logs and clear descriptions of the steps you took prior to the issue occurring help immensely.

Installation

  1. Run the install.sh script to install the latest version of the Tailscale UDM package on your UDM.

    # Install the latest version of Tailscale UDM
    curl -sSLq https://raw.github.com/SierraSoftworks/tailscale-udm/main/install.sh | sh
  2. Run tailscale up to start Tailscale.

  3. Follow the on-screen steps to configure Tailscale and connect it to your network.

  4. Confirm that Tailscale is working by running tailscale status

Management

Configuring Tailscale

You can configure Tailscale using all the normal tailscale up options, you should be able to find tailscale on your path after installation.

tailscale up --advertise-routes=10.0.0.0/24 --advertise-exit-node --advertise-tags=tag:it

Restarting Tailscale

On UniFi OS 2.x+, Tailscale is managed using systemd and the tailscaled service. You can restart it using the following command.

systemctl restart tailscaled

Upgrading Tailscale

Upgrading Tailscale on UniFi OS 2.x+ can be done either using apt or by using the manage.sh helper script.

Using apt
apt update && apt upgrade -y tailscale
Using manage.sh
/data/tailscale/manage.sh update

# Or, if you are connected over Tailscale and want to run the update anyway
nohup /data/tailscale/manage.sh update!

Remove Tailscale

To remove Tailscale, you can run the following command, or run the steps below manually.

/data/tailscale/manage.sh uninstall
Manual Steps
  1. Kill the tailscaled daemon with systemctl stop tailscaled.
  2. Remove the tailscale package using dpkg -P tailscale.
  3. Remove the management script and state using rm -Rf /data/tailscale.

UniFi OS 1.x (Legacy OS on UDM/UDM Pro)

β“˜ You can confirm your OS version by running /usr/bin/ubnt-device-info firmware_detail

Installation

  1. Follow the steps to install the boostchicken on-boot-script here.

    ⚠ Make sure that you exit the unifi-os shell before moving onto step 2 (or you won't be able to find the /mnt/data directory).

  2. Run the install.sh script to install the latest version of the Tailscale UDM package on your UDM.

    # Install the latest version of Tailscale UDM
    curl -sSLq https://raw.github.com/SierraSoftworks/tailscale-udm/main/install.sh | sh
  3. Start Tailscale using /mnt/data/tailscale/tailscale up.

  4. Follow the on-screen steps to configure tailscale and connect it to your network.

  5. Confirm that Tailscale is working by running /mnt/data/tailscale/tailscale status

Management

Configuring Tailscale

You can configure Tailscale using all the normal tailscale up options, you'll find the binary at /mnt/data/tailscale/tailscale. Unfortunately we can't make changes to your $PATH to expose the normal tailscale command, so you'll need to specify the full path when calling it.

/mnt/data/tailscale/tailscale up --advertise-routes=10.0.0.0/24 --advertise-exit-node --advertise-tags=tag:it

Restarting Tailscale

The manage.sh script takes care of installing, starting, stopping, updating, and uninstalling Tailscale. Run it without any arguments to see the options.

/mnt/data/tailscale/manage.sh restart

Upgrading Tailscale

/mnt/data/tailscale/manage.sh update

# Or, if you are connected over Tailscale and want to run the update anyway
nohup /mnt/data/tailscale/manage.sh update!

Remove Tailscale

To remove Tailscale, you can run the following command, or run the steps below manually.

/mnt/data/tailscale/manage.sh uninstall
Manual Steps
  1. Kill the tailscaled daemon with killall tailscaled.
  2. Remove the boot script using rm /mnt/data/on_boot.d/10-tailscaled.sh
  3. Have tailscale cleanup after itself using /mnt/data/tailscale/tailscaled --cleanup.
  4. Remove the tailscale binaries and state using rm -Rf /mnt/data/tailscale.

Contributing

There are clearly lots of folks who are interested in running Tailscale on their UDMs. If you're one of those people and have an idea for how this can be improved, please create a PR and we'll be more than happy to incorporate the changes.

Frequently Asked Questions

How do I advertise routes?

You do this by updating your Tailscale configuration as you would on any other machine, just remember to provide the full path to the tailscale binary when doing so.

# Specify the routes you'd like to advertise using their CIDR notation

# UniFi OS 1.x
/mnt/data/tailscale/tailscale up --advertise-routes="10.0.0.0/24,192.168.0.0/24"

# UniFi OS 2.x/3.x
tailscale up --advertise-routes="10.0.0.0/24,192.168.0.0/24"

Can I route traffic from machines on my local network to Tailscale endpoints automatically?

In theory, yes - however it does require manual changes to your routing rules and these will need to be updated if you take advantage of WAN fail-over. This has been discussed in more detail here.

Note that we do not currently include this in tailscale-udm due to the risk of breaking conflicts in future.

Why can't I see a network interface for Tailscale?

Tailscale runs as a userspace networking component on the UDM rather than as a TUN interface, which means you won't see it in the ip addr list.

Does this support Tailscale SSH?

You bet, make sure you're running the latest version of Tailscale and then run tailscale up --ssh to enable it. You'll need to setup SSH ACLs in your account by following this guide.

# UniFi OS 1.x
# Update Tailscale to its latest version
/mnt/data/tailscale/manage.sh update!

# Enable SSH advertisment through Tailscale
/mnt/data/tailscale/tailscale up --ssh

# UniFi OS 2.x/3.x
# Update Tailscale to its latest version
/data/tailscale/manage.sh update!

# Enable SSH advertisment through Tailscale
tailscale up --ssh

More Repositories

1

Iridium

A high performance MongoDB ORM for Node.js
TypeScript
568
star
2

bash-cli

A command line framework built using nothing but Bash and compatible with anything
Shell
96
star
3

multicast

A multicast channel library for Go with a simple API and familiar semantics
Go
25
star
4

vue-template

A Vue.js web application template designed to be as lightweight as possible while offering an extensive set of features
TypeScript
24
star
5

Skmatc

Skmatc (schematic) is the powerful JavaScript object validation framework powering Iridium
JavaScript
23
star
6

sentry-go

A beautifully simple Sentry client which makes reporting errors a joy! Full support for breadcrumbs and stacktraces with an elegant and easy to remember API.
Go
20
star
7

minback-postgres

A container which provides the ability to backup a PostgreSQL database to Minio on demand
Dockerfile
19
star
8

git-tool

Stop worrying about where your code is saved and start being more productive with this cross-platform CLI (with auto-complete and GitHub integration).
Rust
15
star
9

Lithium

Lithium is a licensing protocol which provides the ability to provide time locked, floating and leased licensing both over the internet and through an intranet server.
C#
13
star
10

connor

Connor is a condition evaluator for Go inspired by MongoDB's query language
Go
12
star
11

minback-mongo

A container which provides the ability to backup a MongoDB database to Minio on demand
Shell
10
star
12

markout

Native Markdown support in Outlook
TypeScript
9
star
13

minback-mysql

A MySQL backup container which ships the backup to S3
Dockerfile
9
star
14

honeypot

A service designed to track malicious SSH login attempts
Go
6
star
15

RackMan

A Node.js cluster manager for high performance horizontally scaled web applications, powering all our servers
JavaScript
5
star
16

roadmap

Manage your project and team road maps in YAML
Go
5
star
17

inki

An agent which allows you to register new SSH keys on a host through a combination of PGP signing, an HTTP API and host-side checks.
Go
5
star
18

human-errors-rs

Errors for Rust which make your users' lives easier
Rust
4
star
19

chieftan-server

The Chieftan server implementation
Go
4
star
20

shig

Cryptographically sign and verify files using SSH keys
Go
4
star
21

grey

Lightweight OpenTelemetry native health probing system
Rust
3
star
22

hue

Control your Phillips Hue lights using the command line.
Go
3
star
23

blmain

Migrate your GitHub repositories to use a "main" branch instead of "master" (supports Azure DevOps and Travis CI)
C#
3
star
24

Isotope

Isotope is an integrated hardware USB HID emulation solution for devices with a UART - specifically a Raspberry Pi
C
3
star
25

buckle

Lightweight bootstrapping of servers, with amazing observability and practically no fluff.
Rust
3
star
26

stablehand

A tool to help keep your Rancher server clean in production environments
Go
3
star
27

GuardHouse

A flexible JSON based access control system for Node.js
JavaScript
2
star
28

vault-azfn

Run Hashicorp Vault on Azure Functions (with scale-to-zero)
HCL
2
star
29

Kong

A notification distributor designed to simplify passing of notifications between different services.
JavaScript
2
star
30

heimdall

Heimdall is a distributed availability check platform built with an emphasis on performance, flexibility and security.
Go
2
star
31

gatekeeper

Gate Keeper is a permissions management tool for Go applications
Go
2
star
32

chieftan-frontend

A web frontend for the Chieftan task automation tool
TypeScript
2
star
33

Executor

A Go task runner designed to run scripts across a wide range of platforms
Go
2
star
34

ynab-githubactions

Automatically update the value of your stock portfolio in You Need a Budget
TypeScript
2
star
35

mocha-gitlablist

Provides a custom Mocha reporter compatible with GitLab-CI
JavaScript
2
star
36

SiteForge

SiteForge is a powerful static website generator built on Node.js
JavaScript
2
star
37

rex-rs

Tool for keeping track of ideas and providing random ones on demand
Rust
2
star
38

rex-ui

A user interface for Rex, providing a random idea for something to do on demand.
TypeScript
1
star
39

burnout-rs

An anonymous burnout tracking tool for teams
Rust
1
star
40

Canal

A powerful route design helper for Express
JavaScript
1
star
41

ansible-docker

A docker image for execution of Ansible playbooks
Shell
1
star
42

update-go

Go
1
star
43

timespan-js

A C#-esque TimeSpan object for JavaScript
JavaScript
1
star
44

sshsign-go

Cryptographically sign data using your SSH keys in Go
Go
1
star
45

scheduler

A small scheduling library for Go which makes running tasks at different times easy
Go
1
star
46

Suspenders

Realtime Asynchronous WebSocket RPC Using SockJS
JavaScript
1
star
47

minback-cleanup

A backup rotation tool for Minio backups created by the various minback containers
Go
1
star
48

rex-csharp

Tool for keeping track of ideas and providing random ones on demand
C#
1
star
49

chat

A simple chat protocol to practice writing network servers and clients
Go
1
star
50

Express-DSN

Custom notification framework for Express
JavaScript
1
star
51

node-conversation

Allows fluent testing of advanced TCP servers for protocol compliance
JavaScript
1
star
52

rates

Simple rate limiting primitives for Go
Go
1
star
53

Concoction

A flexible preprocessing framework for Node.js
JavaScript
1
star
54

windows-essentials

Links to various pieces of software installed as part of a base Windows development machine
PowerShell
1
star
55

on-call

Generate fair on-call schedules with a simple, declarative, specification
Rust
1
star
56

github-automerge

Automatically merge dependabot pull requests across your entire organization.
TypeScript
1
star
57

girder

Girder is an oppinionated Go web API toolkit
Go
1
star
58

Optimum

A full stack HTML+JS+CSS minification an optimization framework for single page web applications
JavaScript
1
star