Git Product home page Git Product logo

openwrt-tailscale's Introduction

Tailscale on Smaller OpenWRT Devices

Warning

This project generates binaries automatically and does not come with any warranty. As of the time of writing, Tailscale v1.58.2 works fine on Xiaomi Mi Router 4A Gigabit Edition running OpenWrt 22.03.3. Proceed with caution and use this software at your own risk.

This project is a slightly modified version of this guide.

Installation

Pre-requisites

Set the environment variables for the Tailscale version and your router's architecture:

export VERSION="1.58.2"
export ARCH="mips_24kc"

1. Compile a Portable tailscale.combined Binary for Your Device

  • Clone the Tailscale repository and checkout to the release you are building for:
git clone https://github.com/tailscale/tailscale
cd tailscale
git checkout v$VERSION

Follow this guide to build the tailscale.combined binary for your device.

Note

Set the GOOS and GOARCH environment variables when building to cross-compile the binary for your device. For example:

GOOS=linux GOARCH=$ARCH go build -o tailscale.combined -tags ...

Note

The value of $ARCH might not always match the GOARCH environment variable. Verify the correct GOARCH value based on your device's architecture. For more details on supported values, refer to this guide.

  • Run the final built tailscale.combined through upx to compress it:
upx --lzma --best ./tailscale.combined

2. Download the IPK

wget https://github.com/du-cki/openwrt-tailscale/releases/download/v$VERSION/tailscale_$VERSION-1_$ARCH.ipk

3. Move Files to Your Router

  • Transfer the tailscale.combined binary and the IPK file to your router's /tmp directory:
scp -O ./tailscale.combined [email protected]:/tmp
scp -O tailscale_$VERSION_$ARCH.ipk [email protected]:/tmp/tailscale.ipk

4. Install Dependencies and Tailscale

opkg update
opkg install kmod-tun iptables-nft
opkg install /tmp/tailscale.ipk

5. Use the Portable Version of Tailscale

  • Replace the installed tailscale and tailscaled binaries with the portable version:
rm /usr/sbin/tailscaled
rm /usr/sbin/tailscale
cd /usr/sbin
cp /tmp/tailscale.combined .
ln -s tailscale.combined tailscaled
ln -s tailscale.combined tailscale
  • Verify your installation:
tailscale --version

If you see an error, it means that the tailscale.combined binary is not compiled for the correct architecture. Remove the tailscale.combined binary and compile it again for the correct architecture.

6. Start Tailscale

  • Restart the Tailscale daemon:
service tailscale restart
  • Start Tailscale with the --netfilter-mode=off flag to prevent iptables rules from being created. This setting will be preserved in /etc/tailscale/tailscaled.state for future boots:
tailscale up --netfilter-mode=off

openwrt-tailscale's People

Contributors

du-cki avatar github-actions[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.