What's new

TAILMON TAILMON v1.0.20 -July 27, 2024- WireGuard-based Tailscale Installer, Configurator and Monitor (Now available in AMTM!)

  • 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!

Viktor Jaep

Part of the Furniture
TAILMON v1.0.20
Released July 27, 2024

First off – Wanted to give huge thanks to @jksmurf for lighting this fire… He opened my eyes to Tailscale and its capabilities, and only became natural to want to fullfill his wishes to create a formal installer/monitor for this valuable tool for others to enjoy. He, along with @Aiadi, @kuki68ster and @ColinTaylor made a fantastic team that has been working diligently in the background testing the capabilities, limits and stability of Tailscale on our routers. Hats off to all these gentlemen for their help and insight that went into making this tool.

Executive Summary: Tailscale is a free and open source service, based on WireGuard®, that helps users build no-hassle virtual private networks. Once you’ve created a Tailscale network (tailnet), you can securely access services and devices on that tailnet from anywhere in the world. TAILMON is a posix shell script that assists with the install, configuration and monitoring of Tailscale, running on your Asus-Merlin FW router. What is Tailscale you ask? Read more here!

Use-case: TAILMON allows you to download and install Tailscale via Entware onto your router, in order to join your router to your Tailscale network (tailnet). When joined, you can optionally designate your router to become an exit node, and/or advertise access to your subnet in order to allow access to devices running on your network… think NAS devices, TVs, Raspberry Pi’s, Ubuntu servers, security cameras. Once installed, you can monitor your Tailscale service and connection with TAILMON, which will optionally restart the service/connection should something bring it down. To make life easier, TAILMON can continue running/monitoring in the background using the SCREEN utility.

WIKI: Based on our group's findings and extensive testing, @ColinTaylor built this fantastic Tailscale on Merlin WIKI which dives more into the underlying components and how to manually use the Tailscale tools to make a successful connection. Thank you for providing this great instruction manual!

TAILMON is free to use under the GNU General Public License version 3 (GPL 3.0).

This project is hosted on GitHub

Latest release notes: <available here!>

Changelog here | What's new: Added Site-to-Site capabilities, Arm7-2.6 Architecture/Kernel compatibility, Mostly maintenance items, Tailscale Updates, Reboot Protection + showing TS versions, Initial Release!

Screenshots:

1716514715476.png


How is this script supposed to run?

In a normal, daily mode, this script would run from a standard SSH connection. In monitoring mode, it would be running under the SCREEN utility. Instructions:

1. Download and install directly using your favorite SSH tools, copy & paste this command (or install directly from AMTM!):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/TAILMON/master/tailmon.sh" -o "/jffs/scripts/tailmon.sh" && chmod 755 "/jffs/scripts/tailmon.sh"

2. Run TAILMON for the first time to get it setup, or just running the script normally using this command:
Code:
sh /jffs/scripts/tailmon.sh

3. Configure advanced settings using this command (or by pressing (C) from the operations menu in the UI):
Code:
sh /jffs/scripts/tailmon.sh -setup

4. To make things easier, you can now just type the script name itself (without the path/extension), like so… NOTE: You will need to completely exit your SSH session, and log back in for this feature to immediately start working – basically logout/login!
Code:
tailmon

5. Running it under the SCREEN utility is also easy... Make sure to exit the SCREEN session properly by pressing CTRL A + D!
Code:
tailmon -screen
 
Last edited:
How do I set up TAILMON and Tailscale!?

Here are steps on installing the script and getting it configured for Tailscale...

1.) First, go to https://tailscale.com, and create a free account. The free version of Tailscale lets you manage up to 3 individual user accounts, and 100 devices! That should be plenty for us experimental enthusiast crowd!

2.) Upon downloading TAILMON, and running it for the first time (sh /jffs/scripts/tailmon.sh), you will be prompted with an "Install Dependencies" screen. This will install a few Entware tools that are used by TAILMON.

1714431242135.png


3.) Once complete, you will be prompted with the "Initial Setup" screen. Here you have a choice between "Express Install" and "Advanced Install". For those new to Tailscale, I would recommend the "Express Install" to get you up and running as quickly and easily as possible.

1714431313154.png


4.) During the "Express Install" process, you will see Tailscale getting downloaded and installed, after which, it will try to join your router to your Tailscale Network (tailnet). You need to copy and paste the URL it presents into your browser, in order to validate that this is the equipment you want to add to your tailnet.

1714431434102.png


5.) After you validate the machine, it will continue on to the main UI. From here you have some keyboard shortcuts available from the Operations Menu on the very top. Below that will show Tailscale service and connection status. As you add more devices to your tailnet, you will see the list growing under the "Tailscale Connection Status". Finally, it will also show exactly what service and commandline switches it is utilizing to establish and maintain your connection to Tailscale.

1716514739752.png
 
Last edited:
Advanced Options:

1.) From the main UI, you can press (C) for the Configuration/Setup Menu (or you can get to this same screen directly using sh /jffs/scripts/tailmon.sh -setup). This menu also functions as the "Advanced Install" menu, giving you full control over the install/uninstall of the Tailscale service/connection, lets you stop/start, and bring the connection up/down. You are also able to update the Tailscale binary here to the latest version, as well as being able to issue a '[B]tailscale up --reset[/B]' command. Here is also where you can set the Operating Mode, configure the router as an exit node, and advertise routes for your own subnet to your tailnet.

1716514781997.png


2.) Pressing (3) "Set Tailscale Operating Mode" lets you choose between "Userspace", "Kernel" and "Custom". Userspace Mode is used by default, and seems the least intrusive to the router, and tends to overlay on top of the OS. Kernel mode has a much tighter integration with the OS, which may interfere with some processes. Which of these modes is the best? They both seem to perform about the same, so it's really a toss-up, unless I uncover further info based on performance or other issues to sway my mind. In both of these modes, the main service and commandline options are chosen for you to utilize these modes. In the Custom mode, you have full control over all options, and can add your own custom settings and commandline options.

1714437946026.png


3.) Continuing from the screen above, choosing Option (3) for the Custom Operating Mode gives you access to edit all major sections that control the Tailscale Service and Connection:

1714438608267.png


4.) From the Configuration/Setup Menu, pressing option (6) "Custom Configuration Options" gives you a bit more functionality to manage your Tailscale install. Here's a brief explanation for each function:
  • Keep Tailscale Service Alive - Setting to Yes will monitor the Tailscale Service, and if it determines that it's down, will automatically restart it.
  • Timer Check Loop Interval - The amount of seconds that it checks for Tailscale Service issues
  • Custom Event Log size - The number of rows the eventlog will grow to before it starts trimming itself down
  • AMTM Email Notifications - Requires AMTM email to be setup and configured, but will send you success/failure events via email
  • Keep settings on Tailscale Entware updates - If Tailscale is upgraded, it will lose it's settings. This function will make sure that settings will be synced back and survive an update without downtime.
  • Autostart TAILMON on Reboot - This option autostarts TAILMON if your router happens to reboot, and continues monitoring your Tailscale service/connection in a Screen session.
1714609532512.png


If anyone has any questions on the functionality of TAILMON or Tailscale in general, feel free to post questions in the thread below! ENJOY!
 
Last edited:
Full credit and massive thanks to @Viktor Jaep for his patience in adding oil to the squeaky wheel and to the indefatigable @ColinTaylor for the wisdom.

A wee shoutout to @RandomUser777 for ‘making it work’ initially and to @JA93 who gave us a nudge. 🙏
 
Last edited:
Thanks much to @ColinTaylor for finding an inconsistency in the uninstaller code! v1.0.1 is out! Quick patch on release day! LOL :)

What's new?
v1.0.1 - (April 29, 2024)
- PATCH:
Straight out of the gate, and @ColinTaylor makes a great observation that the uninstaller is still referring to an older Tailscale directory structure that was recently changed. Thanks Colin! This has been patched! :)

Download link (Or update directly within TAILMON):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/TAILMON/master/tailmon.sh" -o "/jffs/scripts/tailmon.sh" && chmod 755 "/jffs/scripts/tailmon.sh"
 
@Viktor Jaep , if we have already installed using Colins github faq, should I just reverse the steps to completely uninstall?
 
@Viktor Jaep , if we have already installed using Colins github faq, should I just reverse the steps to completely uninstall?
I believe so, yes; but assuming you did so (install using the wiki) very recently, you could also possibly install Tailmon then use the uninstall function in the Addon.

I say recently as there was a path amended by Colin quite recently.

When I was playing around with it I searched opt and mnt for Files and Dirs containing *tailscale* using WinSCP.

[EDIT] See also the Wiki for the manual uninstall procedure.
 
Last edited:
@Viktor Jaep , if we have already installed using Colins github faq, should I just reverse the steps to completely uninstall?
You should be able to install the script on top of what you currently have. The act of selecting an operating mode should correct any path issues a previous install may have.
 
You should be able to install the script on top of what you currently have. The act of selecting an operating mode should correct any path issues a previous install may have.
@Viktor Jaep that’s good to know, that it will revert to a working install under Tailmon.

Just coming back to the cleaning up exercise though, will any legacy directories and/or files from the wiki-install remain in place, ones that would have to be removed manually ?
 
@Viktor Jaep Just coming back to the cleaning up exercise though, will any legacy directories and/or files from the wiki-install remain in place, ones that would have to be removed manually ?
That would be manual. Perhaps a good approach would be to uninstall the Tailscale entware package, then performing a "tailscale" search to find any old legacy directories and wipe those out before reinstalling?
 
Was successfully using a manual install using the Wiki, but trying to migrate to this script now.

Got this error during installation:
Code:
/jffs/scripts/tailmon.sh: line 2080: can't create /jffs/addons/tailmon.d/tailmon.log: nonexistent directory
(multiple times)
 
Additionally, after finishing the Express Installation, the script returned to the selection between Express and Advanced Installation (claiming nothing was installed). When I tried the same Express Installation again the script continued to the main menu.

Even after starting a new SSH session "tailmon" is not found as a command, but that's probably because I run zsh as my shell? (I just noticed that Skynet's firewall is not an alias either, so settings in /jffs/configs/profile.add seem to be ignored - which is my issue; not of this script)
 
Last edited:
Was successfully using a manual install using the Wiki, but trying to migrate to this script now.

Got this error during installation:
Code:
/jffs/scripts/tailmon.sh: line 2080: can't create /jffs/addons/tailmon.d/tailmon.log: nonexistent directory
(multiple times)
Could you please explain the steps you took that got you to this error so I can try to replicate?
 
Additionally, after finishing the Express Installation, the script returned to the selection between Express and Advanced Installation (claiming nothing was installed). When I tried the same Express Installation again the script continued to the main menu.
And this was with already having Tailscale installed through your manual method?

This is also another indication that the /jffs/addons/tailmon.d folder didn't exist... because it wasn't able to find the .cfg file, which would have been in that same folder.
 
@XIII ... I think I figured out how you did that... after install, you ran tailmon.sh -setup straight out of the gate. I got similar errors. Let me work on a fix.
 
Was successfully using a manual install using the Wiki, but trying to migrate to this script now.

Got this error during installation:
Code:
/jffs/scripts/tailmon.sh: line 2080: can't create /jffs/addons/tailmon.d/tailmon.log: nonexistent directory
(multiple times)
@XIII... this has been patched. Please uninstall what you've got (setup menu #9), and download a fresh version... please give it another shot. Also, that (O) option in the operations menu is for the Custom Operating Mode only... I should probably hide or gray it out if Custom isn't enabled.

Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/TAILMON/master/tailmon.sh" -o "/jffs/scripts/tailmon.sh" && chmod 755 "/jffs/scripts/tailmon.sh"
 
Last edited:
Looks like some of the initial install items were able to get bypassed by running the -setup switch right out of the gate... this has been patched. Thanks @XIII !

What's new?
v1.0.2 - (April 30, 2024)
- PATCH:
Thanks to @XIII, for finding an inconsistency that we hadn't stumbled across yet. After an install, when running tailmon.sh -setup immediately after resulted in errors showing that it was not able to write the .log and .cfg files into their /jffs/addons/tailmon.d folder, because that folder gets created upon running tailmon.sh by itself. Emergency fix has been patched! Thanks!

Download link (or update directly within TAILMON):
Code:
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/TAILMON/master/tailmon.sh" -o "/jffs/scripts/tailmon.sh" && chmod 755 "/jffs/scripts/tailmon.sh"
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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