Every now and then my Samba share stops working.
$ smbclient -U sambauser '\\192.168.12.11\Apartment'
do_connect: Connection to 192.168.12.11 failed (Error NT_STATUS_CONNECTION_REFUSED)
This is incredibly annoying, since it happens somewhat frequently too. I restart the container, with no fix. It might be client-side, but I’m boggled by how that could even occur. There are no logs in systemd for smbd. The firewall is disabled.
/etc/samba/smb.conf: https://pastebin.com/HNgw8YcV
Connection refused is generally a network level issue meaning that a firewall is rejecting the tcp handshake, or more likely samba is not listening on that IP.
So you are attempting to connect to your samba server and the OS (not Samba) is saying there is no service running on that port so I am refusing your connection request.
So you have one of these problems
Even if those interface names are correct sometimes network managers rename interfaces. So when Samba starts that might be the wrong interface name, but by the time you login it is correct. I would just remove that line and the bind interfaces only line as well unless you specifically need to bind to specific interfaces.
Try connecting to samba from the server itself on 127.0.0.1, which will probably work just fine because lo is probably a correct interface.
You can also look at what interfaces/IP samba is listening on by running one of these commands as root
ss -tlp | grep 445
netstat -nlp | grep 445