This is a step by step guide to install Tailscale VPN and setup Subnet router on Ubuntu OS. The guide will allow installation on both physical hardware, KVM virtual machine, as well as unprivileged LXC containers.
Ignore the following part if not using LXC containers. Edit the LXC container config file from the host machine. In this example, lets say the LXC container ID is 102.
nano /etc/pve/lxc/102.confAdd at the bottom of the config file:
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=fileThis step onward is applicable for all.
Run the following in the machine you are installing Tailscale on to setup the subnets:
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.confThen install tailscale with the following command:
curl -fsSL https://tailscale.com/install.sh | shBring up the tailscale with the subnet:
sudo tailscale up --advertise-routes=10.0.0.0/24,192.168.1.0/24Copy the url provided into your browser to login and edit the device to approve the subnet router request.
That’s it.