FreeBSD 12.3-RELEASE, Samba 4.13, and Workgroup networking

From: David Christensen <dpchrist_at_holgerdanske.com>
Date: Sun, 17 Apr 2022 21:39:45 UTC
samba:

I have a home/ SOHO network with various Windows, macOS, Linux, FreeBSD, 
iosOS, and Android clients, and a FreeBSD server, all connected with 
Gigabit Ethernet.  I have Samba and workgroup networking partially 
working, and am trying to troubleshoot the remainder.


Here is the server:

2022-04-16 12:40:48 toor@f3 ~
# freebsd-version ; uname -a
12.3-RELEASE-p4
FreeBSD f3.tracy.holgerdanske.com 12.3-RELEASE-p3 FreeBSD 
12.3-RELEASE-p3 GENERIC  amd64


The server has a jail running Samba:

2022-04-17 14:07:14 toor@samba ~
# pkg info | grep samba
samba413-4.13.14               Free SMB/CIFS and AD/DC server and client 
for Unix

2022-04-17 14:07:11 toor@samba ~
# testparm -s
Load smb config files from /usr/local/etc/smb4.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

# Global parameters
[global]
	ntlm auth = ntlmv1-permitted
	preferred master = Yes
	security = USER
	server string = Samba Server Version %v
	wins support = Yes
	idmap config * : backend = tdb


[dpchrist]
	path = /var/local/samba/dpchrist
	read only = No
	valid users = dpchrist


When I restart Samba:

2022-04-17 14:07:40 toor@samba ~
# service samba_server restart
Performing sanity check on Samba configuration: OK
Stopping smbd.
Waiting for PIDS: 15066.
Stopping nmbd.
Waiting for PIDS: 15059.
Performing sanity check on Samba configuration: OK
Starting nmbd.
Starting smbd.


I see warnings and errors in the logs:

2022-04-17 14:09:11 toor@samba ~
# tail -n 17 /var/log/samba4/log.nmbd
[2022/04/17 14:08:22.083092,  0] ../../source3/nmbd/nmbd.c:960(main)
   nmbd version 4.13.14 started.
   Copyright Andrew Tridgell and the Samba Team 1992-2020
[2022/04/17 14:08:22.084747,  0] 
../../source3/nmbd/asyncdns.c:158(start_async_dns)
   started asyncdns process 23444
[2022/04/17 14:08:22.085748,  0] 
../../lib/util/become_daemon.c:136(daemon_ready)
   daemon_ready: daemon 'nmbd' finished starting up and ready to serve 
connections
[2022/04/17 14:08:45.802815,  0] 
../../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
   *****

   Samba name server SAMBA is now a local master browser for workgroup 
WORKGROUP on subnet 192.168.5.24

   *****
[2022/04/17 14:08:56.843770,  0] 
../../source3/nmbd/nmbd_browsesync.c:354(find_domain_master_name_query_fail)
   find_domain_master_name_query_fail:
   Unable to find the Domain Master Browser name WORKGROUP<1b> for the 
workgroup WORKGROUP.
   Unable to sync browse lists in this workgroup.

2022-04-17 14:10:00 toor@samba ~
# tail -n 13 /var/log/samba4/log.smbd
[2022/04/17 14:08:22.130690,  0] ../../source3/smbd/server.c:1784(main)
   smbd version 4.13.14 started.
   Copyright Andrew Tridgell and the Samba Team 1992-2020
[2022/04/17 14:08:22.235908,  0] 
../../lib/util/become_daemon.c:136(daemon_ready)
   daemon_ready: daemon 'smbd' finished starting up and ready to serve 
connections
[2022/04/17 14:08:22.242952,  0] 
../../source3/lib/util_sock.c:334(open_socket_in)
   open_socket_in(): socket() call failed: Protocol not supported
[2022/04/17 14:08:22.243071,  0] 
../../source3/smbd/server.c:1077(smbd_open_one_socket)
   smbd_open_one_socket: open_socket_in: Protocol not supported
[2022/04/17 14:08:22.243095,  0] 
../../source3/lib/util_sock.c:334(open_socket_in)
   open_socket_in(): socket() call failed: Protocol not supported
[2022/04/17 14:08:22.243114,  0] 
../../source3/smbd/server.c:1077(smbd_open_one_socket)
   smbd_open_one_socket: open_socket_in: Protocol not supported


I am able to connect to Samba shares from Debian 9:

2022-04-17 14:21:08 dpchrist@tinkywinky ~
$ grep samba/dpchrist /etc/fstab
//samba/dpchrist				/home/dpchrist/samba/dpchrist	cifs	 
noauto,vers=3.0,user,username=dpchrist	0	0

2022-04-17 14:21:45 dpchrist@tinkywinky ~
$ mount samba/dpchrist/
Password for dpchrist@//samba/dpchrist:  ********

2022-04-17 14:21:50 dpchrist@tinkywinky ~
$ mount | grep samba/dpchrist
//samba/dpchrist on /home/dpchrist/samba/dpchrist type cifs 
(rw,nosuid,nodev,relatime,vers=3.0,sec=ntlmssp,cache=strict,username=dpchrist,domain=SAMBA,uid=13250,forceuid,gid=13250,forcegid,addr=192.168.5.24,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1,user=dpchrist)



The host "samba" is not visible via network browsing from Windows 7 and 
macOS 11.6.2 clients.  However, I am able to connect by entering a UNC path.


STFW some sites recommend wsdd(1) to support network browsing.  I have 
installed py38-wsdd:

2022-04-17 14:24:22 toor@samba ~
# pkg info | grep wsdd
py38-wsdd-0.7.0                Web Service Discovery (WSD) host daemon 
for Samba


But it does not want to start:

2022-04-17 14:24:32 toor@samba ~
# service wsdd status
wsdd is not running.

2022-04-17 14:24:48 toor@samba ~
# service wsdd start
Starting wsdd.
2022-04-17 14:25:19 toor@samba ~
# service wsdd status
wsdd is not running.

2022-04-17 14:26:02 toor@samba ~
# tail -n 23 /var/log/messages
Apr 17 14:25:19 samba daemon[23601]: 2022-04-17 14:25:19,935:wsdd 
WARNING(pid 23602): no interface given, using all interfaces
Apr 17 14:25:20 samba daemon[23601]: Traceback (most recent call last):
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1799, in <module>
Apr 17 14:25:20 samba daemon[23601]:     sys.exit(main())
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1754, in main
Apr 17 14:25:20 samba daemon[23601]:     nm = 
RouteSocketAddressMonitor(aio_loop)
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1058, in __call__
Apr 17 14:25:20 samba daemon[23601]:     obj.enumerate()
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1097, in enumerate
Apr 17 14:25:20 samba daemon[23601]:     self.do_enumerate()
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1471, in do_enumerate
Apr 17 14:25:20 samba daemon[23601]: 
self.parse_route_socket_response(rt_buf.raw, True)
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1505, in parse_route_socket_response
Apr 17 14:25:20 samba daemon[23601]:     new_intf = 
self.parse_addrs(buf, sa_offset, offset + rtm_len, intf, addr_mask, 
rtm_type, intf_flags)
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1551, in parse_addrs
Apr 17 14:25:20 samba daemon[23601]:     self.handle_new_address(addr, 
addr_family, intf)
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
1161, in handle_new_address
Apr 17 14:25:20 samba daemon[23601]:     mch = 
MulticastHandler(addr_family, addr, interface, self.aio_loop)
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
83, in __init__
Apr 17 14:25:20 samba daemon[23601]:     self.init_v4()
Apr 17 14:25:20 samba daemon[23601]:   File "/usr/local/bin/wsdd", line 
163, in init_v4
Apr 17 14:25:20 samba daemon[23601]: 
self.uc_send_socket.bind((self.address, WSD_UDP_PORT))
Apr 17 14:25:20 samba daemon[23601]: OSError: [Errno 48] Address already 
in use


Does anyone know of a good learning resource for workgroup networking on 
Samba 4.13 on FreeBSD 12.3-R?


TIA,

David