Skip to content

du-cki/openwrt-tailscale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 root@openwrt.lan:/tmp
scp -O tailscale_$VERSION_$ARCH.ipk root@openwrt.lan:/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