Script: Update Tailscale on (nearly) all devices

Little bit of background on why this is important in my travel setup.. I travel with an Apple TV, iPhone, iPad, MacBook Air. Obviously all these have tailscale clients available, so it's not a massive issue.. but I don't like to have to connect each one specifically to tailscale. It's easier to just have the berylax connect back to my tailnet and then my extension everything in the hotel room is essentially on the tailnet. The custom exit node becomes important when I want to watch xfinity stream on the Apple TV to watch my local news.. in order to pull that off the Apple TV in my hotel room needs to appear to be coming from a custom exit node on my home network, so I like to just change the tailscale instance on the berylax to use a custom exit node on my home network and then everything in the hotel room (including the Apple TV) appears to be originating back at home going through my xfinity fiber connection to the internet. Without this working on the berylax I'm forced to manually enable the tailscale client on the Apple TV and manually set an exit node there. But doing all this risks me forgetting what I've done and then there exists all sorts of wonkiness where the Apple TV is "double tailscaled" which wrecks havoc, lol. Anyhow.. gotta get ready for work.

The modifying mechanism will run:

sed -i 's|param="--advertise-routes=$routes"|param="--advertise-routes=$routes --stateful-filtering=false"|' /usr/bin/gl_tailscale

Since I don't use Tailscale I am not aware if this is the right or wrong thing to do. It was necessary for some version (1.6.x, don't remember)

stateful-filtering defaults to disabled, don’t see the need for explicitly mentioning it?

Source: Tailscale CLI Β· Tailscale Docs

So the issue may be deeper than just this script.. it may have to do with gl-inet's gl_tailscale script. At another time I can try to hobble my way through that script and make sense of it and see if that's what the issue is; I'm guessing that has to be the actual issue as a custom exit node is never actually set on the berylax. I'm no coder so it'll definitely just be a half hearted attempt to make sense of it.

The web interface on the berylax makes it appear that a custom exit node is set, but 100% for sure if you simply goto whatismyip.com on a device behind the berylax it is in fact not showing the IP of the custom exit node and is 100% showing the IP address of what is plugged into the WAN port of the berylax. In my case, I'm connected via ethernet to the hotel's network (Hampton Inn). Worth mentioning I'm also not multi-homed. I originally had connected to the hotel via wifi until I was able to get the hotel's MSP (GuestTek) to enable the ethernet port in the hotel room. So up until this morning I had two connections to the hotel's network (albeit in failover mode), but I made sure to disable repeater, so I only have the wired connection enabled now.. just incase that was screwing with the tailscale implementation.

1 Like

Maybe other people can help here, since I … can't, sorry. Just created the script without using Tailscale - I am a ZeroTier guy instead.

1 Like

FYI.. I just decided to reboot my berylax with my custom exit node still enabled and when the berylax rebooted.. the custom exit node was still enabled and sure enough the curl from the router showed the proper IP AND hitting whatismyip.com from a device behind the berylax ALSO showed the proper exit node IP. There is something wrong with the glinet's tailscale implementation.. likely in the gl_tailscale script.

Just wanted to say this worked great for my MT6000

1 Like

Hello @admon. I have a AR750s-ext running on OpenWrt 22.03.4, I have downloaded the script, it installs Tailscale but I get the following error at the end.

[2024-08-20 10:50:27] [βœ“] Script finished successfully. The new tailscale version (software, daemon) is:
Illegal instruction
Illegal instruction
root@GL-AR750S:~#

When installing, it detects the version properly...

[2024-08-20 10:50:02] [β†’] Checking if prerequisites are met
[2024-08-20 10:50:02] [βœ“] Firmware version: 4
[2024-08-20 10:50:02] [βœ“] Architecture: mips
[2024-08-20 10:50:02] [βœ“] Available space: 93 MB
[2024-08-20 10:50:02] [!] xz is not installed. We can install it for you later.
[2024-08-20 10:50:02] [βœ“] Prerequisites are met.

Thanks for creating this, it's great, kudos!

Could you please run
grep 'machine' /proc/cpuinfo | awk -F ': ' '{print $2}'

and

uname -a?

1 Like

root@GL-AR750S:/usr/bin# grep 'machine' /proc/cpuinfo | awk -F ': ' '{print $2}'
GL.iNet GL-AR750S (NOR/NAND)

root@GL-AR750S:/usr/bin# uname -a
Linux GL-AR750S 5.10.176 #0 Sun Apr 9 12:27:46 2023 mips GNU/Linux

It's curious... 3 minutes ahead in time.

It isn't the current time, it's the time when the kernel was compiled. So it is fine.

I added some workaround for the GL.iNet GL-AR750S (NOR/NAND).
Please re-run the script to get the newest update

1 Like

I think Tailscale DEVs added an extra ")".....

/usr/sbin/tailscale: line 1: syntax error: unexpected ")"
/usr/sbin/tailscaled: line 1: syntax error: unexpected ")"

Please run the following command:

wget -q https://github.com/Admonstrator/glinet-tailscale-updater/releases/download/v1.72.0/tailscaled-linux-mips -O /tmp/tailscale && chmod +x /tmp/tailscale && /tmp/tailscale --version && rm /tmp/tailscale
1 Like

root@GL-AR750S:/# cd root
root@GL-AR750S:~# wget -q https://github.com/Admonstrator/glinet-tailscale-updater/releases/download/v1.72.0/tailscaled-linux-mips -O /tmp/tailscale && chmod +x /tmp/tailscale && /tmp/tails
cale --version && rm /tmp/tailscale
Illegal instruction
root@GL-AR750S:~#

It appears that there is no suitable tailscale version available right now, I am sorry.

Openwrt has the 1.58 version available. Index of /releases/23.05.4/packages/mips_24kc/packages/

I can install it :slight_smile:

1.58 is pretty old. Current version is 1.7.0

I know... but what else can we do? :stuck_out_tongue: I have a flint 2 as a server on version 1.7.2. I am travelling abroad and I need to have it set it up... any tips?

Please try those commands as well:

wget -q https://github.com/Admonstrator/glinet-tailscale-updater/releases/download/v1.72.0/tailscaled-linux-mips64 -O /tmp/tailscale && chmod +x /tmp/tailscale && /tmp/tailscale --version && rm /tmp/tailscale

wget -q https://github.com/Admonstrator/glinet-tailscale-updater/releases/download/v1.72.0/tailscaled-linux-mips64le -O /tmp/tailscale && chmod +x /tmp/tailscale && /tmp/tailscale --version && rm /tmp/tailscale
1 Like

root@GL-AR750S:~# wget -q https://github.com/Admonstrator/glinet-tailscale-updat
er/releases/download/v1.72.0/tailscaled-linux-mips64 -O /tmp/tailscale && chmod
+x /tmp/tailscale && /tmp/tailscale --version && rm /tmp/tailscale
/tmp/tailscale: line 11: syntax error: unexpected ")"
root@GL-AR750S:~# wget -q https://github.com/Admonstrator/glinet-tailscale-updater/releases/download/v1.72.0/tailscaled-linux-mips64le -O /tmp/tailscale && chmod +x /tmp/tailscale && /tmp/t
ailscale --version && rm /tmp/tailscale
root@GL-AR750S:~#

Second one seems to be the one!