- Implementing Tailscale via the app store in TrueNAS SCALE for secure remote access.
- Advanced configuration of subnet routes and egress nodes to manage local network traffic.
- Alternative installation methods for TrueNAS Core using FreeBSD jails and TUN permissions.
- Optimizing ZFS replication between servers by using dedicated Tailscale network interfaces.
If you have a home server, you probably know that accessing your files or applications when you're not on your local network can be a real headache. To avoid problems with opening ports on your router or complex VPN configurations, tailscale has become the star tool thanks to its simplicity and security based on WireGuard.
Having a working NAS is great, but if you use TrueNAS, whether the SCALE or Core version, you might run into There were a few bumps in the road when trying to assemble this system.It's not just a matter of pressing an install button, but of understand how it interacts with your home network so you don't get any unpleasant surprises when you turn off the server.
Step-by-step installation on TrueNAS SCALE

For those who use Truenas ScaleIt's quite straightforward since we can use the applications tab. The first thing we need is generate an authentication key from the Tailscale administration console. This is essential for the server to automatically join your private network (tailnet) without you having to juggle manual logins.
Once you have the key, Go to the Apps section in TrueNAS, search for Tailscale in the catalog, and click install.Upon entering the editing settings, You must enter the authentication key and hostname that you want the server to have. A vital detail is to check the "Userspace" box for it to work correctly in most standard environments.
If you want your NAS to act as a bridge to access other devices in your home that don't have Tailscale installed, you need to configure the server as a Subnet RouterTo do this, in the routes field, enter the range of your local network, for example 192.168.0.0/24Then, don't forget to validate this range in the Tailscale control panel on the web, by activating the corresponding routes option.
Be careful with routes and network outages

This is where many people make mistakes and end up with a network outage. If you configure a subnet route and the TrueNAS server is the only path to that network, Turning off the server could result in losing access to other devices, including your own router. This happens because the client device believes all traffic to 192.168.0.0/24 It must go through the NAS.
To avoid this problem, some try changing the router's subnet mask (from 192.168.0.1 to 192.168.1.1), but this often breaks connectivity if it's not done on all devices. The key is maintain consistency in the subnet mask between the router, Proxmox, and TrueNAS. If you only need access to the NAS and its apps like Nextcloud, it's sometimes preferable not to advertise the entire subnet unless absolutely necessary.
Another very useful feature is configuring the NAS as Exit NodeThis allows all the traffic from your mobile phone or laptop, even if you're in a café in another city, to pass through your home. You just have to Check the Exit Node box in the TrueNAS app and then enable it in the Tailscale web dashboard..
Advanced configuration for ZFS replication

If you have multiple TrueNAS servers and want to back up data between them seamlessly, you can use Tailscale to do so. Optimize ZFS replicationIn this case, you need to make an important change: Disable the "Userspace" option and enable the "Host Network" option.This will allow the creation of a real network interface called tailscale0.
For this to work at the system level, it is recommended to go to the general settings of the web interface and Make sure the IPv4 address is 0.0.0.0Additionally, if you are going to use SSH for data transfer, you must configure the SSH service to bind specifically to the interface. tailscale0thus guaranteeing a direct and secure connection between the nodes.
When creating the replication task, use the IP address of the tailnet (the one that starts with 100.xyz) and select the transport mode. SSH+NETCATThis combination is what truly maximizes the transfer speed between two TrueNAS SCALE servers connected through the Tailscale mesh.
Installation on TrueNAS CORE (FreeBSD Jails)
In TrueNAS CORE, the story changes because we don't have the same app system. Here, the solution lies in... Installing Tailscale inside a FreeBSD jailThe most critical step in creating the jail is going to the custom properties and select the allow_tun optionWithout this, Tailscale will not be able to create the network tunnel and will never work.
Once inside the jail shell, you may need to change the package repository from "quarterly" to "latest" by editing the file /etc/pkg/FreeBSD.conf to get the latest version. Then, simply run pkg install tailscale and activate the service with service tailscaled enable y start.
To finalize the process in Core, you run tailscale up and follow the authentication link that appears in the terminal. If you prefer not to use the browser, you can use a authentication key directly in the commandOnce connected, you can manage the server from the Tailscale website and, if you wish, disable key expiration so you don't have to re-authenticate the server every few months.
Whether you use the flexibility of SCALE with its apps and exit nodes, or prefer the stability of CORE through jails, the fundamental thing is manage network routes correctly To avoid blocking access to the router. By integrating Tailscale, you achieve robust remote connectivity for your SMB folders and web interface, allowing you to manage your storage from anywhere without compromising your home security.
I am a technology enthusiast who has turned his "geek" interests into a profession. I have spent more than 10 years of my life using cutting-edge technology and tinkering with all kinds of programs out of pure curiosity. Now I have specialized in computer technology and video games. This is because for more than 5 years I have been writing for various websites on technology and video games, creating articles that seek to give you the information you need in a language that is understandable to everyone.
If you have any questions, my knowledge ranges from everything related to the Windows operating system as well as Android for mobile phones. And my commitment is to you, I am always willing to spend a few minutes and help you resolve any questions you may have in this internet world.