Skip to content

Install Tailscale on LXC

Quick instructions for installing Tailscale to LXC container

  1. Create CT
  2. set Hostname. Leave it to "unprivileged". Set password and ID
  3. Tamplate tab → choose ubuntu template
  4. Disk tab → leave it default
  5. cpu tab → leave it default
  6. memory tab → leafe it default
  7. network tab → set IPv4 DHCP or static if you have IP for it
  8. dns tab → set it default
  9. Click Confirm

  10. Start the container. Log in (Console)

  11. to allow remote SSH access edit file /etc / ssh /sshd_config : PermitRootLogin yes
  12. apt update && apt upgrade -y

3. Tailscale install docs: https://tailscale.com/kb/1031/install-linux * #apt install curl -y * #curl -fsSL https://tailscale.com/install.sh | sh * (optonal for running exit node) edit file /etc/sysctl.conf - uncomment line #net.ipv4.ip_forward=1 and #net.ipv6.conf.all.forwarding=1 * shutdown container

4. Apply two lines to proxmox https://tailscale.com/kb/1130/lxc-unprivileged

To allow Tailscale container to access proxmox network, ssh to proxmox. Edit file /etc/pve/lxc/150.conf (150 = change it to the ID of your Tailscale container ID) paste the lines end of the file: lxc.cgroup2.devices.allow: c 10:200 rwm lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file

save file and start container again.

5. log in to the tailscale lxc container and start the service with command: tailscale up

(optonal for enabling exit node for access to proxmox network) tailscale up --advertise-routes=10.10.18.0/24 --advertise-exit-node

6. Copy the tailscale link open in browser. Choose the login type and click "Connect"

with command "tailscale status" you can see all the connected devices

7. (optional) enable the access to the proxmox network From the tailscale admin page click the 3 dots from the server → "edit route settings" and enable the subnet route & exit node

to do IP Forwarding from LXC tailscale container to the host Proxmox server run this command in LXC: echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

If firewall is on in the LXC you have to allow forwarding: iptables -A FORWARD -i tailscale0 -o eth0 -j ACCEPT iptables -A FORWARD -i eth0 -o tailscale0 -m state --state RELATED,ESTABLISHED -j ACCEPT