Tailscale is an awesome opensource project. It leverages WireGuard to create a light weight VPN like connection.
I am using an EdgeRouter X with OpenWRT on it. This router is using a mipsle chipset.
Getting started
Build from source below or download the static bin file from builds
Clone the tailscale repo
git clone https://github.com/tailscale/tailscale.git
Build the mipsle binaries
GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -o tailscale tailscale.com/cmd/tailscale
GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -o tailscaled tailscale.com/cmd/tailscaled
Copy binaries to /usr/sbin/
scp <bins> root@<router-ip>:/usr/sbin/
Install deps
opkg update
opkg install ca-bundle kmod-tun
Create /etc/init.d/tailscaled
NOTE line /usr/sbin/tailscale up is commented out remove comment after logging in manually
#!/bin/sh /etc/rc.common
### BEGIN INIT INFO
# Provides: tailscaled
# Description: tailscaled daemon service
### END INIT INFO
USE_PROCD=1
# starts after network starts
START=21
# stops before networking stops
STOP=89
PROG=/usr/sbin/tailscaled
start_service() {
echo "starting tailscaled"
procd_open_instance
procd_set_param env SERVICE_RUN_MODE=1
procd_set_param command $PROG -state /etc/tailscale/tailscaled.state
procd_set_param pidfile /var/run/tailscaled.pid
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
# /usr/sbin/tailscale up
}
service_triggers() {
procd_add_reload_trigger "tailscaled"
}
Make the file executable
chmod +x /etc/init.d/tailscaled
Test service
/etc/init.d/tailscaled start
/usr/sbin/tailscale up
This should prompt with a url. Use this to authorize the device. If everything is good. Remove the comment in the /etc/init.d/tailscaled (tailscale up)
Enable service
/etc/init.d/tailscaled enable
Reboot
reboot
Verify things are working
Top comments (8)
I'm using:
and for the tailscale I downloaded from pkgs.tailscale.com/unstable/#static
I copied your procd script and after I chmod +x and run it I got this error
when I run tailscaled alone without using the procd it works but when I run it using procd I got that error again
how do I fix this?
What do your other service scripts look like that in, that
/etc/init.d/dir?Maybe taking the first line from one of them and replace the first line in this script will correct the issue you are seeing?
here the inside of cron looks like:
here the inside of boot looks like:
and here the inside of zerotier (installed using opkg) looks like:
Everything looks similar to me? :/
any luck on this one?
Nope, I'm going back to zerotier The speed drawback is not that bad for my workflow anyway ¯_(ツ)_/¯
I am on an older kernel
so maybe there are some diffs. Tailscale is worth the pain to figure it out.
Thanks for the link to the unstable static bins! Saves a few steps!
One way to save space is to add the
-tags ts_include_cliflag when building. This builds a single binary that will act as both the daemon and the utility, depending on the filename.You can then copy this one binary to your edgerouter, and link it as both /usr/sbin/tailscaled and /usr/bin/tailscale, and it will do both jobs.
One thing I'd like some help with - If you install tailscale using apt, the binaries it installs take up a lot less space - while
lsstill says the binary size is over 30MB,du -hsreveals that they only take up 17MB of disk space. Watching the disk space after deleting them agrees with du. After I build new binaries, the same applies to the files while on my computer. But once I copy them to the edgerouter, this is no longer the case - du, ls and df all say the same thing. I've tried taring and gzipping the files, but that doesn't change things. It looks like the binaries are sparse files, and sparse sections are written out on the edgerouter.Any suggestions, and can anyone confirm this on their systems?