I have a VM instance on Oracle Cloud (Ubuntu 22.04) set up with ZeroTier to act as a web server for some services that should work with my local Synology NAS.
For some of those services I also need to mount three SMB shares from my NAS with the ZeroTier tunnel, but I can't make it work. I used mount and mount.cifs plenty of times with automounting too, this time it acts very strange:
/var/log/syslog
readsCIFS: VFS: \\XXX.XXX.XXX.XXX has not responded in 180 seconds.
Reconnecting...
ls
or lsof
or cd
or any other command), it succeeds for only one of the shares (always the same one), but only for the first time any command is given:$ ls /temp
folder1 folder2 folder3
$ ls /temp
█
Just a few times it spits out this error
lsof: WARNING: can't stat() cifs file system /temp
Output information may be incomplete.
ls 1475 ubuntu 3r DIR 0,44 0 123207681 /temp
findmnt
reads:
└─/temp //XXX.XXX.XXX.XXX/Downloads cifs rw,relatime,vers=2.0,cache=strict, username=[redacted],uid=1005,noforceuid,gid=0,noforcegid,addr=XXX.XXX.XXX.XXX,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=65536,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1
umount
and umount -l
take at least 2-3 minutes to successfully unmount the shares.Same behavior when using smbclient
and also with NFS shares from the same NAS.
What I have already tried:
cifs-utils
, smbclient
and so on...mount
, mount.cifs
, autofs
, smbclient
;htop
or anything else. During the "hanging" sessions there is no spike in CPU, RAM or Network usage in either the Oracle VM or Synology NAS;What I haven't tried yet (I'll try as soon as possible):
It seems to me that the mount.cifs process doesn't really succeeds in mounting the share correctly, as it doesn't show as such anywhere. It also seems an issue not related to folder/file permissions, but rather something related to networking?
A note on something that may or may not be related to this: ZeroTier on my Synology NAS does not seems to work with IPv4 only - it remains OFFLINE
. The node goes ONLINE
only when IPv6 is enabled, but I must say that this is the only node in my ZT network that shows a IPv6 as public IP in the ZT web GUI - the other nodes show IPv4 public addresses.
If anyone has any clue on this, I'll be happy to support and reproduce any advice. Thank you!
I'm using YailScale, but I presume it will work the same.
You need to add the port 445 to /etc/iptables/rules.v4
just under the SSH setup like below:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 445 -j ACCEPT (like this)
Then you need to edit the interfaces in /etc/samba/smb.conf
to:
interfaces = lo tailscale0 100.0.0.0/24
Obviously, my interface is tailscale0
, but yours will be different. Use ip link show
to find yours. You may also need to change your IP range to suit ZeroTeirs, such as 100.0.0.0/24
, which is what tailscale uses.
Then reboot!
I couldn't get it working without doing this.