Samba and Tailscale

I have a ubuntu server where we have a samba drive. I need it to run over tailscale, however I can’t get it to work.

I have the smb.conf set to

[global]
   workgroup = WORKGROUP
   server min protocol = NT1
   server string = %h server (Samba, Ubuntu)
   interfaces = lo tailscale0 10.0.0.0/24 
   bind interfaces only = yes
   smb ports = 445
   hosts allow = <tailscale machine ip address here> 10.0.0.0/24 
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *pas>
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes
   create mask = 0775
   directory mask = 0775

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

[share]
  comment = Public Share
  path = /mnt/samba/share
  browseable = yes
  read only = no
  guest ok = yes

  create mask = 0775
  force create mask = 0775
  security mask = 0775
  force security create mask = 0775

  directory mask = 0775
  force directory mask = 0775
  directory security mask = 0775
  force directory security create mask = 0775

ufw is set to:

Anywhere on tailscale0 (v6)    ALLOW   Anywhere (v6)

I can ssh into the server via tailscale, but I can’t get samba though it.

I think this a configuration issue on my tailscale/ routing conf issue - I did set a subroute to 10.0.0.0/24, but I am not sure what to do beyond this.

1 Like

I was experiencing a very similar, if not the same, problem and was lucky to find the solution in this github issue: Samba `interfaces only` config does not include `tailscale0` · Issue #6856 · tailscale/tailscale · GitHub

  • In samba configuration, /etc/samba/smb.conf - Add your interface device name to the interfaces list, mine was eg. enx00e04c6801ec
  • Restart samba
  • Enable mapping of TCP port 445:

tailscale serve tcp:445 tcp://localhost:445

1 Like