Tailscale and Subnet Router: Installation and Configuration Guide

Installing Tailscale on Ubuntu and setting it up to advertise an IP or subnet (acting as a Subnet Router) is a common method to access LAN devices that can't run Tailscale on their own.
1. Install Tailscale
The most reliable way to install on Ubuntu is using the official one-line script:
Bash
curl -fsSL https://tailscale.com/install.sh | sh
2. Enable IP Forwarding
To advertise routes, your Ubuntu machine must be able to forward network traffic. Run these commands to enable it permanently:
Bash
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
3. Advertise the Routes
Now, bring Tailscale up and tell it which local IP ranges you want to share with your Tailscale network (your "tailnet"). Replace the example IP with your actual local network range (e.g., 192.168.1.0/24).
Bash
sudo tailscale up --advertise-routes=192.168.1.0/24
- To advertise as an Exit Node: If you want this machine to route all internet traffic for other devices, use
--advertise-exit-nodeinstead.
4. Approve the Routes in the Admin Console
For security, Tailscale won't start routing traffic until you manually approve it in the dashboard:
Open the Tailscale Admin Console.
Locate your Ubuntu machine and click the three dots (...) menu.
Select Edit route settings.
Under Subnet routes, check the box for the routes you just advertised.
Click Save.
5. Verify the Connection
On another device connected to your Tailscale network, try to ping a device on that local 192.168.1.x subnet. It should now be reachable as if you were physically on that network.



