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.
Set the environment variables for the Tailscale version and your router's architecture:
export VERSION="1.58.2"
export ARCH="mips_24kc"
- 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
throughupx
to compress it:
upx --lzma --best ./tailscale.combined
wget https://github.com/du-cki/openwrt-tailscale/releases/download/v$VERSION/tailscale_$VERSION-1_$ARCH.ipk
- 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
opkg update
opkg install kmod-tun iptables-nft
opkg install /tmp/tailscale.ipk
- Replace the installed
tailscale
andtailscaled
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.
- 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