Coder Social home page Coder Social logo

openwrt-tailscale-enabler's Introduction

Hi there, I'm Adyanth 👋

Website LinkedIn Git Repo Twitter Follow

I'm a Software Developer, MS CS Student @ UCSD

  • 🌱 I've written a Kubernetes Operator that eases configuring and using Cloudflare Tunnels in Kubernetes!
  • 🔭 I've set up my site and my homelab to run on Cloudflare.
  • 🏢 I'm studying Computer Science (M.S.) at University of California, San Diego
  • 👯 I'm looking to expand my knowledge on Golang and K8s
  • 🥅 2022 Goals: Contribute more to open source projects ✅
  • ⚡ Fun fact: I love technology and self-hosting



📕 Latest Blog Posts

➡️ more blog posts...


⚡ Most used languages

Top Languages

⚡ Recent GitHub Activity

  1. ❗ Opened issue #94 in BaldissaraMatheus/Tasks.md
  2. 🗣 Commented on #166 in gurusabarish/hugo-profile
  3. 🔓 Reopened issue #166 in gurusabarish/hugo-profile
  4. ❌ Closed PR #167 in gurusabarish/hugo-profile
  5. 🗣 Commented on #166 in gurusabarish/hugo-profile

⚡ GitHub Stats

Adyanth's GitHub Stats

openwrt-tailscale-enabler's People

Contributors

adyanth avatar dieterplex avatar github-actions[bot] avatar keyakko avatar oocococo avatar ronanj avatar slhck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openwrt-tailscale-enabler's Issues

failed to connect to local tailscaled; it doesn't appear to be running (sudo systemctl start tailscaled ?)

root@GDR-SVR:~# tailscale up --advertise-routes=192.168.1.0/24
Downloading 'https://pkgs.tailscale.com/stable/'
Connecting to 167.172.11.40:443
Writing to stdout

Download completed (24496 bytes)
Downloading Tailscale 1.32.2_mipsle ..
Downloading 'https://pkgs.tailscale.com/stable/tailscale_1.32.2_mipsle.tgz'
Connecting to 167.172.11.40:443
Writing to stdout
tailscale_1.32.2_mipsle/tailscale
-                    100% |*******************************| 18924k  0:00:00 ETA
Download completed (19378646 bytes)
Done!
failed to connect to local tailscaled; it doesn't appear to be running (sudo systemctl start tailscaled ?)
root@GDR-SVR:~# /etc/init.d/tailscale start
root@GDR-SVR:~# tailscale up --advertise-routes=10.0.0.0/24,192.168.1.0/24,192.168.2.0/24
failed to connect to local tailscaled; it doesn't appear to be running (sudo systemctl start tailscaled ?)
root@GDR-SVR:~#

I dont know why, but after extract and start tailscale always showing failed to connect to local tailscaled; it doesn't appear to be running (sudo systemctl start tailscaled ?) all depedency was allready installed. Thanks.

Failed to connect to local tailscaled error

Hi, i followed your installation guide but i'm ending with this error but both tailscale and tailscaled are running

root@R3:~# tailscale up --accept-dns=false --advertise-routes=10.0.0.0/24
Downloading 'https://pkgs.tailscale.com/stable/'
Connecting to 167.172.11.40:443
Writing to stdout

Download completed (22865 bytes)
Downloading Tailscale 1.28.0_mipsle ..
Downloading 'https://pkgs.tailscale.com/stable/tailscale_1.28.0_mipsle.tgz'
Connecting to 167.172.11.40:443
Writing to stdout
tailscale_1.28.0_mipsle/tailscale

  •                 29% |*********                      |  5296k  0:00:09 ETAtailscale_1.28.0_mipsle/tailscaled
    
  •                100% |*******************************| 17680k  0:00:00 ETA
    

Download completed (18105167 bytes)
Done!
failed to connect to local tailscaled; it doesn't appear to be running (sudo systemctl start tailscaled ?)

root@R3:~# ps | grep tailscale
3675 root 1312 S grep tailscale

root@R3:~# ps | grep tailscaled
3677 root 1312 S grep tailscaled

bug

There's a mistake in DNS after my openwrt reboot firstly.

Better way to auto-update?

I am not sure how auto-update is supposed to work.

The /usr/bin/tailscale file checks for the existence of /tmp/tailscale, and only if that one does not exist, it will attempt a download and update. So in any case, an update will only work if those files in tmp are removed entirely before running /usr/bin/tailscale again.

Even then, having to manually edit the file seems a bit hacky.

Can you please clarify how the update procedure should work under normal circumstances?

Fails if no internet on boot

If the router boots without internet, the tailscaled never starts. I am not sure if there is a possible workaround other than waiting for a ping to succeed before starting the download.

arm64 is detected wrongly as aarch64

I have a Belkin RT3200 router.

uname -m shows aarch64, but it's likely a synonym for arm64.

Since tailscale does not host packages for this synonym, downloading fails.

unable to start the service, due to update probably

hi adyanth, thanks for the work.
I was using it on my esxi openwrt, after a reboot the service didn't start automatically. I couldn't find the device online in tailscale's dashboard. And I checked the service with[/etc/init.d/tailscale status] and returned [running].

After that I tried to delete the device and add it again using[tailscale up --accept-dns=false --advertise-routes=10.0.0.0/24], but it still could't work. Here's the log below:

root@iStoreOS:~# tailscale up --accept-dns=false --advertise-routes=10.0.0.0/24
--2023-08-29 15:52:53-- https://pkgs.tailscale.com/stable/
Resolving pkgs.tailscale.com... 199.38.181.239
Connecting to pkgs.tailscale.com|199.38.181.239|:443... failed: Connection refused.
Downloading Tailscale _amd64 ..
--2023-08-29 15:52:53-- https://pkgs.tailscale.com/stable/tailscale__amd64.tgz
Resolving pkgs.tailscale.com... 199.38.181.239
Connecting to pkgs.tailscale.com|199.38.181.239|:443... failed: Connection refused.
gzip: invalid magic
tar: Child returned status 1
tar: Error is not recoverable: exiting now

I pinged pkg.tailscale.com and it was working. Got no idea where the problem lies.

Installation hangs while writing to stdout

After running 'Tailscale up --accept-dns=false --advertise-routes=10.0.0.0/24', the download operation hangs after writing to stdout;

Downloading 'https://pkgs.tailscale.com/stable/'

Connecting to 167.172.11.40:443
Writing to stdout

Download completed (24496 bytes)
Downloading Tailscale 1.32.2_mipsle ..
Downloading 'https://pkgs.tailscale.com/stable/tailscale_1.32.2_mipsle.tgz'
Connecting to 167.172.11.40:443
Writing to stdout
tailscale_1.32.2_mipsle/tailscale
-                     24% |*******                        |  4640k  0:00:00 ETAKilled
tar: unexpected end of file
tar: short read

This behavior appear to be documented on this blog.
The router is running a fresh installation of OpenWrt on the most recent firmware, other info below:

Model | Asus RT-AC51U
Architecture | MediaTek MT7620A ver:2 eco:6
Target Platform | ramips/mt7620
Firmware Version | OpenWrt 22.03.2 r19803-9a599fee93 / LuCI openwrt-22.03 branch git-22.288.45147-96ec0cd
Kernel Version | 5.10.146

Unable to download binares from tailscale

Problem:
Trying to download https://pkgs.tailscale.com/stable/tailscale_1.8.5_armv7l.tgz returns 404 by tailscale's server.

~# tailscale up --accept-dns=false --advertise-routes=10.0.0.0/24
Downloading Tailscale 1.8.5_armv7l ..
Downloading 'https://pkgs.tailscale.com/stable/tailscale_1.8.5_armv7l.tgz'
Connecting to 167.172.11.40:443
HTTP error 404
tar: invalid magic
tar: short read
mv: can't rename '/tmp/tailscale_1.8.5_armv7l/*': No such file or directory
Done!
/usr/bin/tailscale: line 29: /tmp/tailscale: not found

This will break everytime tailscale builds new versions as they only provide the newest at their server.

MagicDNS prohibits startup

The DNS settings from tailscale with MagicDNS are there after reboot and prohibits the download of tailscale and any other update.

Lost in update process

Hi,

I've managed to install tailscale on Archer C7 v5 (128MB ram / 16MB flash). So far so good and looking forward to update it as being notified in the admin panel for using an older version. The current version on https://pkgs.tailscale.com/stable/#static seems to be tailscale_1.12.3_mips.tgz while the one installed on router is:

root@OpenWrt:/usr/bin# tailscale --version
1.8.5
tailscale commit: 118cf0cd75f92bbe3d994a5b1587c9ea3553221b
other commit: c6fd9c9d5657e82c2d7888804ebce0e8bd6a4556
go version: go1.16.4-ts1b677aa

, on git hub page the reference is for version="1.2.10_mips" which seams be higher than 1.12.3 as last version on download page. Confused here.

Moreover the size of tailscale/tailscaled in tailscale_1.12.3_mips.tgz package is around 10MB each file while the one installed with openwrt-tailscale-enabler is around 1KB each. So I am probably looking at wrong packages for the update on my openwrt router. Kindly request some guidelines.

ipk

请问这个可以生成ipk文件安装吗? 更新下载二进制文件 怎样解压缩 是直接解压缩上传换文件 还是需要命令解压 请具体的说一下 谢谢 谢谢

Please teach me!

Taillscale is installed on openwrt, which is very convenient to use.

When I need to upgrade tailscale, how do I deploy it in openwrt?

Thank you so much!

Unable to establish SSL connection when "tailscale up"

root@iStoreOS:~# tailscale up --accept-dns=false --advertise-routes=192.168.31.0/24
--2023-06-17 16:39:59--  https://pkgs.tailscale.com/stable/
Resolving pkgs.tailscale.com... 199.38.181.239
Connecting to pkgs.tailscale.com|199.38.181.239|:443... connected.
Unable to establish SSL connection.
Downloading Tailscale _arm64 ..
--2023-06-17 16:39:59--  https://pkgs.tailscale.com/stable/tailscale__arm64.tgz
Resolving pkgs.tailscale.com... 199.38.181.239
Connecting to pkgs.tailscale.com|199.38.181.239|:443... connected.
Unable to establish SSL connection.
gzip: invalid magic
tar: Child returned status 1
tar: Error is not recoverable: exiting now
root@iStoreOS:~# 

can not up,when wget

[root@xxx:/tmp]#opkg install libustream-openssl ca-bundle kmod-tun
Package libustream-openssl (2016-07-02-ec80adaa-2) installed in root is up to date.
Package ca-bundle (20160104) installed in root is up to date.
Package kmod-tun (3.14.79-1) installed in root is up to date.
[root@xxx:/tmp]#/etc/init.d/tailscale start
[root@xxx:/tmp]#tailscale up --accept-dns=false --advertise-routes=x.x.x.0/
24
Connecting to pkgs.tailscale.com (199.38.181.239:443)
wget: server returned error: HTTP/1.0 400 Bad Request
Downloading Tailscale _mipsle ..
Connecting to pkgs.tailscale.com (199.38.181.239:443)
wget: server returned error: HTTP/1.0 400 Bad Request
tar: invalid magic
tar: short read
[root@xxx:/tmp]#busybox
BusyBox v1.24.1 (2019-02-01 20:53:40 UTC) multi-call binary.
[root@xxx:/tmp]#cat /etc/openwrt_release
DISTRIB_ID="PandoraBox"
DISTRIB_CODENAME="19.02"
DISTRIB_RELEASE="19.02"
DISTRIB_VERSION="4802"
DISTRIB_REVISION="2019-02-01-git-93f2639a7"
DISTRIB_TARGET="ralink/mt7621"
DISTRIB_DESCRIPTION="PandoraBox 19.02 2019-02-01-git-93f2639a7"
DISTRIB_TAINTS="no-all busybox"
DISTRIB_MANUFACTURER="PandoraBox-Team"
DISTRIB_MANUFACTURER="http://www.pandorabox.com.cn"
[root@xxx:/tmp]#cat /etc/openwrt_version
4802

not issue but a question

I'm sorry this is not to report an issue but a question.

Is this script downloading tailscale binaries lively to /tmp and soft linking them to internal storage? If it does, that is a good idea for storage constrained devices, I am going to try it out.

Thank you very much.

Everytime reboot openwrt, tailscale can't work

/etc/init.d/tailscale enable (has enabled)

but Everytime reboot openwrt, the Tailscale admin panel shows openwrt connected (iphone also connected), but my iphone can't connect with openwrt.
but after use this
tailscale up
/etc/init.d/tailscale start
It can connect again.

is there a method to restart tailscale one more time after openwrt rebooted?

tailscale cert error

When generating the certificate, http 500 responded

# tailscale cert openwrt.mydomain.ts.net
500 Internal Server Error: failed to get cert dir

system log shows "certDir: no TailscaleVarRoot"
The workaround is adding statedir option to /usr/bin/tailscaled

/tmp/tailscaled --statedir=/tmp "$@"

edit: it's tailscale 1.32.3

Disable auto-update

Hi there @adyanth,

Thanks for your work, its all working well on my Teltonika RUTX OpenWRT routers.

How can I disable the auto-update? I'd prefer to update tailscale manually as these devices are in the field.

Thanks

James

Headscale not able to access automatically

I applied the following to /etc/rc.local, it is working nice with tailscale .
sleep 15
tailscale up --advertise-exit-node --advertise-routes=192.168.0.0/24,192.168.8.0/24

Now I applied the following to my VPS, it is not working
tailscale up --advertise-exit-node --advertise-routes=192.168.0.0/24,192.168.8.0/24 --login-server=http://:8080

it seems that tailscale visit tailscle.com regularly, where can I find the setting to switch to my VPS IP?

Doesn't work for devices with 64MB of RAM

I tried different things (zram, etc.) but still couldn't make it work with 64MB of RAM - even if the device manages to download the tailscale package to get the binaries to /tmp, it become practically unusable due lack of memory and tailscale up can't finish.

Do both of tailscale and tailscaled binaries are necessary? Can we skip one of them during the installation?

Unusual use after openwrt restart

The installation is successful and the use is normal. But after restarting the route, /tmp only downloads tailscaled,but tailscale will not download, and the management background shows that it is connected, other sub-machines cannot pass the exit-node , I don’t know why

Help!

When I do the installation of tailscale on openwrt, after getting to "opkg install libustream-openssl ca-bundle kmod-tun", I get the following message:
Multiple packages that provide the same name (libgcc1 and libgcc1) are marked as HOLD or PREFER. use the latest.
The package libustream-openssl20201210 (2022-01-16-868fd881-1), installed in the root directory, is up to date.
The package ca-bundle (20211016-1) installed in the root directory is up to date.
The package kmod-tun (5.15.46-1), installed in the root directory, is up to date.
Collected errors.

  • pkg_hash_check_unresolved: cannot find dependency kernel (= 5.10.131-1-cf749d8daf0bdc1e420cbc608ee57b33) for kmod-tun

Please, how should I fix it?

Thank you very much!

How do i uninstall it?

Hi,

How do i remove it from the system? I worked successfully for me. But somehow, it gets frequently disconnected, i supposed it being removed from RAM. So i compiled, a smaller binary (~5 Mb) using official guide and transferred it over scp to openwrt. when i run tailscale, i get an error "failed to connect to local tailscaled; it doesn't appear to be running".

I believe i need to undo the changes made by this script and delete the tunnel and then run tailscale again. So far, i have deleted the tar package, tailscale(d).
Please inform, how can i undo the changes made by this script and start afresh?

Something weird happens with binaries

When I extract the archive and try running any binary, I get errors like:

root@OpenWrt:/tmp/ts/tailscale_1.30.2_mips# tailscale -h
/usr/sbin/tailscale: line 1: syntax error: unexpected "("

I downloaded the proper archive I think:
https://pkgs.tailscale.com/stable/tailscale_1.30.2_mips.tgz

ANy idea what could be the issue?

Can't install Tailscale - init.d permissions & bin/tailscaled - read-only

ASUSWRT-Merlin RT-AX92U 3004.388.4_0-gnuton1 Wed Oct 25 19:14:25 UTC 2023
timoyi@router:/tmp/home/root# ls
openwrt-tailscale-enabler-v1.36.1-fb2f6cf-autoupdate.tgz
timoyi@router:/tmp/home/root# tar x -zvC / -f openwrt-tailscale-enabler-v1.36.1-fb2f6cf-autoupdate.tgz
usr/
usr/bin/
usr/bin/tailscaled
tar: can't remove old file usr/bin/tailscaled: Read-only file system
timoyi@router:/tmp/home/root# /etc/init.d tailscale start
-sh: /etc/init.d: Permission denied


RT-AX92U (aarch64) FW-388.4 @ 10.0.0.1
Operation Mode: Wireless router

amtm - the Asuswrt-Merlin Terminal Menu

/mnt/router Size 28.3G Used 86.3M (0%)

ep manage Entware packages

fd run Format disk fdl show log

sh manage shell history
cj show all cron jobs
i show all available scripts or tools
u check for script updates

amtm options

e exit t theme r reset a about


Enter amtm option ep


Entware package options

This router runs Entware aarch64-k3.10
Server in use: bin.entware.net

See available packages list here:
https://bin.entware.net/aarch64-k3.10/Packages.html

  1. Check for updated Entware packages
  2. Show installed Scripts and Entware packages
  3. Select Entware server to use
  4. Remove Entware

Enter selection [1-4 e=Exit] 2

Installing required Entware package 'column'
for a better file presentation.

Downloading https://bin.entware.net/aarch64-k3.10/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Installing column (2.39-2) to root...
Downloading https://bin.entware.net/aarch64-k3.10/column_2.39-2_aarch64-3.10.ipk
Installing libsmartcols (2.39-2) to root...
Downloading https://bin.entware.net/aarch64-k3.10/libsmartcols_2.39-2_aarch64-3.10.ipk
Configuring libsmartcols.
Configuring column.


List of installed Entware packages (9)

ca-bundle - 20230311-1 libc - 2.27-11 libpthread - 2.27-11 libsmartcols - 2.39-2 tailscale - 1.46.1-1
column - 2.39-2 libgcc - 8.4.0-11 librt - 2.27-11 libssp - 8.4.0-11

Entware Apps installed in /opt/bin/ (9)

column entware-services grep localedef.new tailscaled
egrep fgrep locale.new tailscale

Entware Apps installed in /opt/sbin/ (0)

Did i miss a prequesite somewhere?

it's keep downloading tailscale

i skimmed through your code, it seems to download the latest version every time reboots or does the command tailscale [cmd] after reboot.
at first i set per readme tailscale up --accept-dns=false --advertise-routes=192.168.1.0/24 everything went fine. rebooting devices and i want to change to tailscale up --accept-dns=false --advertise-routes=192.168.1.0/24 --advertise-exit-node is downloading assets again.

what's happen if connection are lost while downloading when we aren't at office/home where openwrt installed to

Binary path change

I noticed that by default, regular opkg Tailscale package installs binaries to /usr/sbin compared to /usr/bin that this repo uses.
Is that n intentional decision to avoid overwriting each other or something else?

requests & bug: stable version for architectures are differents

386: tailscale_1.46.0_386.tgz
amd64: tailscale_1.46.0_amd64.tgz
arm: tailscale_1.46.0_arm.tgz
arm64: tailscale_1.44.2_arm64.tgz
geode: tailscale_1.46.0_geode.tgz
mips: tailscale_1.46.0_mips.tgz
mips64: tailscale_1.46.0_mips64.tgz
mips64le: tailscale_1.46.0_mips64le.tgz
mipsle: tailscale_1.46.0_mipsle.tgz
riscv64: tailscale_1.46.0_riscv64.tgz

my devices are arm64, and based on your script will got 1.46.0 not found, it's should be 1.44.2. add checking for different architectures,
e.g wget -O- https://pkgs.tailscale.com/stable/ | grep -o 'tailscale_[0-9.]*_arm64.tgz' | grep -o '[0-9.]*' | head -n 1 will get 1.44.2, hopefully you are updating this. thank you very much

Available as snapshot

Tailscale command line interface and daemon are now in the OpenWRT snapshot repository.

Kenapa downloadingnya ke versi tailscale 1.52.1 ? padahal sy instal tgz dari link update terbaru ?

tailscale up --accept-dns=true --advertise-routes=192.168.51.0/24 --accept-routes=true --advertise-exit-node=true --ssh=true
Downloading 'https://pkgs.tailscale.com/stable/'
Connecting to 199.38.181.239:443
Writing to stdout

Download completed (36668 bytes)
Downloading Tailscale 1.52.1_mipsle ..
Downloading 'https://pkgs.tailscale.com/stable/tailscale_1.52.1_mipsle.tgz'
Connecting to 199.38.181.239:443
Redirected to /stable/tailscale_1.52.1_mipsle.tgz on dl.tailscale.com
Connection error: Connection failed
tar: invalid magic

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.