What's new

Tutorial **Tailscale On Merlin**

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

opkg install tailscale*.ipk - updated :)
Nice, it just gets better and better. Well done.

Quick question please, does the install survive a Router reboot?

i.e. once all the settings and routes are typed in initially, Tailscale up (or Tailscale start) and the advertised routes etc are retained if for some reason the Router reboots? Thanks 🙏

Would the Tailscale auto-update command work in this particular environment?
 
Last edited:
Nice, it just gets better and better. Well done.

Quick question please, does the install survive a Router reboot?

i.e. once all the settings and routes are typed in initially, Tailscale up (or Tailscale start) and the advertised routes etc are retained if for some reason the Router reboots? Thanks 🙏

Would the Tailscale auto-update command work in this particular environment?
I'm using default S06tailscaled:
#!/bin/sh

ENABLED=yes
PROCS=tailscaled
ARGS="--state=/opt/var/tailscaled.state"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

. /opt/etc/init.d/rc.func

After reboot u need to start it manually probably. No custom stuff added. (auto-update, etc)
S06tailscaled - you can always set according to your preference
 
I'm using default S06tailscaled:


After reboot u need to start it manually probably. No custom stuff added. (auto-update, etc)
You can easily update it to suits your needs tho. (S06tailscaled - set according to your preference)
Thank you for the clarification.

If you were taking requests for feature updates (options to select at install time) these two would be mine 1. Survives a reboot, one of my routers is 9k km away; and 2. Tailscale autoupdate toggle on.

For 2. I can run the command in SSH but I’m not near experienced enough to update it to make it survive a reboot. From my tinkering I believe you’d need lines in services-start or firewall-start or both but I would be wary that I’d break something in your install by doing this.
 
Last edited:
Thank you for the clarification.

If you were taking requests for feature updates (options to select at install time) these two would be mine 1. Survives a reboot, one of my routers is 9k km away) and 2. Tailscale autoupdate toggle on.

For 2. I can run the command in SSH but I’m not near experienced enough to update it to make it survive a reboot. From my tinkering I believe you’d need lines in services-start or firewall-start or both but I would be wary that I’d break something in your install by doing this.
Actually I just checked it, it auto-starts out of the box. You just need to start it the first time ./S06tailscaled
 
opkg install tailscale*.ipk - updated :)
Sorry to sound dim but have no experience doing this at all. How does that work? I downloaded the *.ipk to my desktop but what next? Thanks in advance for your help.
 
Interesting. As for next quest feel free to try my script and give suggestions

Right, I thought I would back out of my previous Tailscale install and undo all the changes, remove the added files (but not remove the amended ones), remove my Router from the Tailnet, reboot the Router, then try this install from scratch to give you some feedback.

The deleted or amended files from my old install include:
  • Deleted tailscale and tailscaled from /opt/bin/ (although I belivee this current install puts them back anwyay).
  • Deleted /tmp/mnt/MYDRVNAME/tailscale dir and all files in it (as JA93's install puts the file tailscaled.state in /tmp/mnt/MYDRVNAME/entware/var which is actually the same as /opt/var).
  • Changed
    -------
    ARGS="-tun=userspace-networking -statedir /mnt/MYDRVNAME/tailscale/"
    -------
    to
    -------
    ARGS="--state=/opt/var/tailscaled.state"
    -------
  • Removed these entries from the services-start script (in the jffs/scripts dir ):
    -------
    /opt/etc/init.d/S06tailscaled start
    tailscale up --accept-routes --advertise-routes=192.168.9.0/24

    -------
  • Removed these entries from the firewall-start script (also in jffs/scripts dir ):
    -------
    tailscale up --accept-routes --advertise-routes=192.168.9.0/24
    -------
Unfortunately I've fallen at the first hurdle, my apologies this is most probably due to my sparse Linux knowledge than any issue with your ipk.
  • opkg install tailscale*.ipk by itself did not work; nor did the opkg install tailscale_nohf_*.ipk version; [EDIT] nor should it, my mistake, the * is just pointing out to choose one of multiple architecture variants.
  • So I tried opkg install tailscale_1.64.0_aarch64-3.10.ipk without success. [EDIT; because at this stage the file was not downloaded from GitHub to /tmp/.
  • I checked my Entware packages were all up to date (using amtm) and they were OK. Googling the errors suggest a missing directory but I have not deleted any directories.
  • So then I downloaded the latest Tailscale ipk file from your Github site here https://github.com/bobanilic/MerlinScale/releases/tag/1.64.0 (I used tailscale_1.64.0_aarch64-3.10.ipk as my Router is that architecture), put it in tmp using WinSCP and ran opkg install tailscale_1.64.0_aarch64-3.10.ipk. Same error.
  • So then I tried to get it directly from your site using opkg install https://github.com/bobanilic/MerlinScale/releases/tag/1.64.0/tailscale_1.64.0_aarch64-3.10.ipk. Same error.
Is there something basic I am missing here? Or am I issuing the commands wrong?
 

Attachments

  • Error Installing.jpg
    Error Installing.jpg
    74.8 KB · Views: 14
  • Also Not Working.jpg
    Also Not Working.jpg
    138.2 KB · Views: 16
  • Entware.jpg
    Entware.jpg
    206.1 KB · Views: 17
Last edited:
Right, I thought I would back out of my previous Tailscale install and undo all the changes, remove the added files (but not remove the amended ones), remove my Router from the Tailnet, reboot the Router, then try this install from scratch to give you some feedback.

Unfortunately I've fallen at the first hurdle, my apologies this is most probably due to my sparse Linux knowledge than any issue with your ipk.
Is there something basic I am missing here? Or am I issuing the commands wrong?
Ok, I think that I may have figured out how to do first step. Moved "tailscale_1.64.0_aarch64-3.10.ipk" to folder /tmp/Tailscale/ using WinSCP and then ran the following using SSH: opkg install /tmp/Tailscale/tailscale_1.64.0_aarch64-3.10.ipk which appears to have installed package. Will see if the rest works.....
 
Ok, I think that I may have figured out how to do first step. Moved "tailscale_1.64.0_aarch64-3.10.ipk" to folder /tmp/Tailscale/ using WinSCP and then ran the following using SSH: opkg install /tmp/Tailscale/tailscale_1.64.0_aarch64-3.10.ipk which appears to have installed package. Will see if the rest works.....
Thanks!

I ran:
opkg install /tmp/tailscale_1.64.0_aarch64-3.10.ipk

I had put it in tmp, and that works.
I am still not sure if the original command should do this automagically but with help from Aiadi, found a way, all good.

It responded like this so seems a good start:
Upgrading tailscale on root from 1.58.2-1 to 1.64.0...
Configuring tailscale.


Next was this line which was OK:
/opt/etc/init.d/S06tailscaled start

Bit confused between the Github version /opt/etc/init.d/S06tailscaled start and /opt/etc/init.d# ./S06tailscaled start ???

The next step tailscale up was not OK, it said:
failed to connect to local tailscaled; it doesn't appear to be running

So I ran:
chmod 755 /opt/bin/tailscale
chmod 755 /opt/bin/tailscaled


Then ran:
tailscale up again

Now it went fine (it gave me the expected link for my browser).
It seems these two chmod lines should be issued before tailscale up?

Then added my Routes
tailscale up --accept-routes --advertise-routes=192.168.9.0/24

Then checked the Tailscale Admin:
It asked me to Approve the Route (did that), all good there.

Then issued:
/opt/etc/init.d/S06tailscaled check
It gave me Alive!

Then:
Went to Tailnet Admin and selected this Router to be a subnet Router, expiry disabled (personal preference).

Then:
Rebooted and supposedly had Internet but could not access the WebGUI, or SSH in via Putty or WinSCP in at all, just locked out.
Switched off the Router, it came up and I could log in, but now Tailscale was not running. [EDIT] It seems that toggling the setting from 'Connected' to 'Disconnect' in the Tailscale on my Windows Desktop allows me log in to my Router again (after the reboot). Conflict?

Then Ran:
/opt/etc/init.d/S06tailscaled start again. OK in the Tailnet Admin.

Then:
Disabled it as subnet Router in Tailscale admin (to check if it survives a reboot).
It did not survive the reboot (for me), it again disappears from the Tailnet admin and via SSH tailscale status says:

failed to connect to local tailscaled; it doesn't appear to be running

Actually checking again, it's even weirder than that:
Even without rebooting, if I exit out of Putty SSH Access, the Router simply disappears as being active in the Tailscale Admin and I have to go back in to SSH and when I issue:

/opt/etc/init.d/S06tailscaled check it says
Checking tailscaled... dead.

Tailscale status
says:
failed to connect to local tailscaled; it doesn't appear to be running

This is repeatable and really weird.

I can make it start again with /opt/etc/init.d/S06tailscaled start but that's not really a practical workaround.

Hopefully this will give you feedback and help others at my level to try the install. As they say, when you make something foolproof, what invariably happens is that you discover a better fool; I cannot speak for Aiadi but I am happy to wear that mantle :).
 
Last edited:
Next was this line which was OK:
/opt/etc/init.d/S06tailscaled start
I am totally stuck here with this error: line 10: can't open '/opt/etc/init.d/rc.func'

Router reboot and Tailscale reinstall using first step have not helped at all.
 
I am totally stuck here with this error: line 10: can't open '/opt/etc/init.d/rc.func'

Router reboot and Tailscale reinstall using first step have not helped at all.
Not sure I can help here TBH. Your S06tailscaled looks like this?

#!/bin/sh

ENABLED=yes
PROCS=tailscaled
ARGS="--state=/opt/var/tailscaled.state"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

. /opt/etc/init.d/rc.func


Your rc.func is rw-r--r--?
Not sure if a copy of my one helps (remove the .txt).
 

Attachments

  • rc.func.txt
    2.8 KB · Views: 5
Last edited:
"tailscale up --accept-routes --advertise-routes=192.168.9.0/24" - don't forget that u need to approve routes in your tailscale dashboard, have u done that? @jksmurf
"I am totally stuck here with this error: line 10: can't open '/opt/etc/init.d/rc.func'" - can you share the process or ss? @Aiadi

PS
If you used earlier "custom features" such as auto-update or similar, see if its related to rc.func. There might be some leftovers which are making mess.

 
Last edited:
"tailscale up --accept-routes --advertise-routes=192.168.9.0/24" - don't forget that u need to approve routes in your tailscale dashboard, have u done that? @jksmurf
"I am totally stuck here with this error: line 10: can't open '/opt/etc/init.d/rc.func'" - can you share the process or ss? @Aiadi

Hi,

Thanks for coming back, sorry I forgot to say I did that approval OK, yup, I've got 2 Tailnets running with about 9 devices in each, so I've gotten use to doing a fair bit of approving before they get added (and it was actually added and worked, just not after the reboot). Will amend post above.
 
Your rc.func is rw-r--r--?
Seems that my "rc.func" was somehow broken (despite a fresh and clean firmware followed by a new Entware installs)!

It seems these two chmod lines should be issued before tailscale up?
They should actually be issued even earlier before "/opt/etc/init.d/S06tailscaled start" as process will not start before fixing permissions.


A new problem now: The tailscale process seems to be stopping shortly after running:


Thanks both for your help.
 
Last edited:
Seems that my "rc.func" was somehow broken (despite a fresh and clean firmware followed by a new Entware installs).


They should actually be issued even earlier before "/opt/etc/init.d/S06tailscaled start" as process will not start before cfixing permissions.

Thanks both for your help.
Does it survive a reboot? atm, mine does not.

Actually checking again, it's even weirder than that.
Even without rebooting, if I exit out of Putty SSH Access, the Router disappears from the Tailscale Admin and I have to go back in to SSH and when I issue:

/opt/etc/init.d/S06tailscaled check it says
Checking tailscaled... dead.

Tailscale status
says
failed to connect to local tailscaled; it doesn't appear to be running

This is repeatable, and really weird.
I would try to capture the screen as a video to show it but it has too many personal IP address etc.
 
Last edited:
Did not even survive with router still running (see my edited post above)!!
Right - see my post 😅 ! Two data points seem to be similar here. That's actually good news, hopefully JA93 has something to work with here (and it's not just me being a numpty).
 
@Aiadi @jksmurf
These are mine, and auto-start work after reboot.
Also, make sure you downloaded correct architecture according to your Router model.
Check your arch:
opkg print-architecture

In case you want to start clean, you can always reformat USB and install fresh Entware and rest or even do Hard Reset of Router on top of it. (don't forget to backup your router settings)
 

Attachments

  • S06tailscaled.txt
    245 bytes · Views: 7
  • rc.func.txt
    2.9 KB · Views: 6
  • rc.unslug.txt
    1,014 bytes · Views: 5
Last edited:
@Aiadi @jksmurf
These are mine, and auto-start work after reboot.
Also, make sure you downloaded correct architecture according to your Router model.
Check your arch:
opkg print-architecture

In case you want to start clean, you can always reformat USB and install fresh Entware and rest or even do Hard Reset of Router on top of it. (don't forget to backup your router settings)
Hmm.. files seems OK. S06tailscaled had an extra (blank) line below the last text but I do not see that being an issue.

Pretty sure Chip Arch is OK,
@RT-AX86U:/tmp/home/root# opkg print-architecture
arch all 100
arch aarch64-3.10 160


I guess the brute force option is an option but I've got Diversion and MerlinAU and a Swap file on there so might leave it for a bit.

Bit odd though that both me and Aiadi have a similar issue with it not only not being persistent over a reboot, it is not persisent when you just exit the Putty screen; never seen that before.

[EDIT] Maybe there is a reason RandomUser777 ended up using the ARGS line in S06tailscaled that he did, for the aarch64 architecture, could this be worth exploring?
 

Attachments

  • S06Tailscaled_NoDiff.jpg
    S06Tailscaled_NoDiff.jpg
    38.2 KB · Views: 15
  • RCUnslung_NoDiff.jpg
    RCUnslung_NoDiff.jpg
    46.8 KB · Views: 13
  • RCFunc_NoDiff.jpg
    RCFunc_NoDiff.jpg
    55.6 KB · Views: 15
Last edited:
I guess the brute force option is an option but I've got Diversion and MerlinAU and a a Swap file on there so might leave it for a bit.

Mine was a clean start with USB reformat and a fresh Entware (and firmware) install but with exactly the same problems as yours.
 
They should actually be issued even earlier before "/opt/etc/init.d/S06tailscaled start" as process will not start before fixing permissions.
Hopefully, if he is in agreement, JA93 can consider amending his 1st first post in this regard for the benefit of others.

Still not sure whether what we did with opkg install(ing) the .ipk files was the correct procedure or not though.
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top