[Samba] "smbd_open_one_socket: open_socket_in failed: Cannot assign requested address"?

Gilles
Sat, 21 Jun 2025 21:58:40 -0000

Hello,

Google didn't help finding why Samba can't listen to the Ethernet card
on a fresh Debian 12 host: "systemctl status smbd"
says?"smbd_open_one_socket: open_socket_in failed: Cannot assign
requested address".

Any idea what it could be?

Thank you.

=========== remove AppArmor
root at debian-dell:~# systemctl stop apparmor
root at debian-dell:~# systemctl disable apparmor
root at debian-dell:~# apt remove --assume-yes --purge apparmor

=========== smb.conf
root at debian-dell:~# cat /etc/samba/smb.conf
[global]
netbios name = DEBIAN-DELL
server role = standalone
security = user
disable netbios = yes
smb ports = 445

map to guest = Bad User
guest account = www-data

;interfaces = lo, enp4s0
interfaces = 192.168.0.19/24 127.0.0.1/32
bind interfaces only = Yes

log level = 2

printcap name = /dev/null
load printers = no
printing = bsd

[my_data]
path = /my_data
;comment = No need for Unix/Samba passwords
guest ok = yes
writeable=yes
browseable=yes
create mode = 0644

=========== netstat
root at debian-dell:~# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address? ? ? ? ? ?Foreign Address ?State? ? ?
 ?PID/Program name
tcp? ? ? ? 0? ? ? 0 0.0.0.0:80? ? ? ? ? ? ? 0.0.0.0:* ?LISTEN? ? ?
322/nginx: master p
tcp? ? ? ? 0? ? ? 0 127.0.0.1:445? ? ? ? ? ?0.0.0.0:* ?LISTEN? ? ? 346/smbd
tcp? ? ? ? 0? ? ? 0 0.0.0.0:22? ? ? ? ? ? ? 0.0.0.0:* ?LISTEN? ? ?
328/sshd: /usr/sbin
tcp? ? ? ? 0? ? ? 0 192.168.0.19:5357? ? ? ?0.0.0.0:* ?LISTEN? ? ?
315/python3
tcp6? ? ? ?0? ? ? 0 :::80? ? ? ? ? ? ? ? ? ?:::* ? LISTEN? ? ?
322/nginx: master p
tcp6? ? ? ?0? ? ? 0 :::22? ? ? ? ? ? ? ? ? ?:::* ? LISTEN? ? ? 328/sshd:
/usr/sbin
tcp6? ? ? ?0? ? ? 0 fe80::280:64ff:fef:5357 :::* ? LISTEN? ? ? 315/python3
udp? ? ? ? 0? ? ? 0 0.0.0.0:68? ? ? ? ? ? ? 0.0.0.0:* ? ? ? ? ? ?
 ?285/dhclient
udp? ? ? ? 0? ? ? 0 192.168.0.19:123? ? ? ? 0.0.0.0:* ? ? ? ? ? ? ?318/ntpd
udp? ? ? ? 0? ? ? 0 127.0.0.1:123? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ? ?318/ntpd
udp? ? ? ? 0? ? ? 0 0.0.0.0:123? ? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ? ?318/ntpd
udp? ? ? ? 0? ? ? 0 0.0.0.0:5353? ? ? ? ? ? 0.0.0.0:* ? ? ? ? ? ?
 ?302/avahi-daemon: r
udp? ? ? ? 0? ? ? 0 0.0.0.0:58680? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ?
 ?302/avahi-daemon: r
udp? ? ? ? 0? ? ? 0 192.168.0.19:3702? ? ? ?0.0.0.0:* ? ? ? ? ? ?
 ?315/python3
udp? ? ? ? 0? ? ? 0 239.255.255.250:3702? ? 0.0.0.0:* ? ? ? ? ? ?
 ?315/python3
udp? ? ? ? 0? ? ? 0 0.0.0.0:33601? ? ? ? ? ?0.0.0.0:* ? ? ? ? ? ?
 ?315/python3
udp6? ? ? ?0? ? ? 0 :::37815? ? ? ? ? ? ? ? :::* ? ? ? ? ? ? ?
302/avahi-daemon: r
udp6? ? ? ?0? ? ? 0 2a01:e0a:590:fd80:2:123 :::* ? ? ? ? ? ? ? 318/ntpd
udp6? ? ? ?0? ? ? 0 fe80::280:64ff:fefd:123 :::* ? ? ? ? ? ? ? 318/ntpd
udp6? ? ? ?0? ? ? 0 ::1:123? ? ? ? ? ? ? ? ?:::* ? ? ? ? ? ? ? 318/ntpd
udp6? ? ? ?0? ? ? 0 :::123? ? ? ? ? ? ? ? ? :::* ? ? ? ? ? ? ? 318/ntpd
udp6? ? ? ?0? ? ? 0 :::5353? ? ? ? ? ? ? ? ?:::* ? ? ? ? ? ? ?
302/avahi-daemon: r
udp6? ? ? ?0? ? ? 0 :::37413? ? ? ? ? ? ? ? :::* ? ? ? ? ? ? ? 315/python3
udp6? ? ? ?0? ? ? 0 fe80::280:64ff:fef:3702 :::* ? ? ? ? ? ? ? 315/python3
udp6? ? ? ?0? ? ? 0 ff02::c:3702? ? ? ? ? ? :::* ? ? ? ? ? ? ? 315/python3

=========== IP address
root at debian-dell:~# ifconfig
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>? mtu 1500
 ? ? ? ? inet 192.168.0.19? netmask 255.255.255.0? broadcast 192.168.0.255
 ? ? ? ? inet6 2a01:e0a:590:fd80:280:64ff:fefd:7ac6? prefixlen 64
scopeid 0x0<global>
? ? ? ? inet6 fe80::280:64ff:fefd:7ac6? prefixlen 64? scopeid 0x20
 ? ? ? ? ether 00:80:64:fd:7a:c6? txqueuelen 1000? (Ethernet)
 ? ? ? ? RX packets 349? bytes 39295 (38.3 KiB)
 ? ? ? ? RX errors 0? dropped 0? overruns 0? frame 0
 ? ? ? ? TX packets 382? bytes 65214 (63.6 KiB)
 ? ? ? ? TX errors 0? dropped 0 overruns 0? carrier 0? collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>? mtu 65536
 ? ? ? ? inet 127.0.0.1? netmask 255.0.0.0
 ? ? ? ? inet6 ::1? prefixlen 128? scopeid 0x10<host>
 ? ? ? ? loop? txqueuelen 1000? (Local Loopback)
 ? ? ? ? RX packets 24? bytes 3977 (3.8 KiB)
 ? ? ? ? RX errors 0? dropped 0? overruns 0? frame 0
 ? ? ? ? TX packets 24? bytes 3977 (3.8 KiB)
 ? ? ? ? TX errors 0? dropped 0 overruns 0? carrier 0? collisions 0

=========== Samba loading interfaces
root at debian-dell:/etc/samba# tail -f /var/log/samba/log.smbd
...
[2025/06/21 23:38:49.757538,? 2]
../../source3/param/loadparm.c:2897(lp_do_section)
 ? Processing section "[my_data]"
[2025/06/21 23:38:49.759065,? 2]
../../source3/lib/interface.c:611(interpret_interface)
 ? interpret_interface: Adding interface 192.168.0.19/24
 ? added interface 192.168.0.19/24 ip=192.168.0.19 bcast=192.168.0.255
netmask=255.255.255.0
[2025/06/21 23:38:49.759228,? 2]
../../source3/lib/interface.c:584(interpret_interface)
 ? interpret_interface: using netmask value 32 from config file on
interface lo
 ? added interface lo ip=127.0.0.1 bcast=127.255.255.255
netmask=255.255.255.255

=========== check Samba status
root at debian-dell:/etc/samba# systemctl status smbd

? smbd.service - Samba SMB Daemon
 ? ? ?Loaded: loaded (/lib/systemd/system/smbd.service; enabled; preset:
enabled)
 ? ? ?Active: active (running) since Sat 2025-06-21 23:32:32 CEST; 17min ago
 ? ? ? ?Docs: man:smbd(8)
 ? ? ? ? ? ? ?man:samba(7)
 ? ? ? ? ? ? ?man:smb.conf(5)
 ? ? Process: 308 ExecCondition=/usr/share/samba/is-configured smb
(code=exited, status=0/SUCCESS)
 ? ? Process: 330
ExecStartPre=/usr/share/samba/update-apparmor-samba-profile
(code=exited, status=0/SUCCESS)
 ? ? Process: 359 ExecReload=/bin/kill -HUP $MAINPID (code=exited,
status=0/SUCCESS)
 ? ?Main PID: 346 (smbd)
 ? ? ?Status: "smbd: ready to serve connections..."
 ? ? ? Tasks: 3 (limit: 1829)
 ? ? ?Memory: 29.9M
 ? ? ? ? CPU: 908ms
 ? ? ?CGroup: /system.slice/smbd.service
 ? ? ? ? ? ? ???346 /usr/sbin/smbd --foreground --no-process-group
 ? ? ? ? ? ? ???351 /usr/sbin/smbd --foreground --no-process-group
 ? ? ? ? ? ? ???352 /usr/sbin/smbd --foreground --no-process-group

Jun 21 23:32:24 debian-dell systemd[1]: Starting smbd.service - Samba
SMB Daemon...
Jun 21 23:32:32 debian-dell smbd[346]: [2025/06/21 23:32:32.431602, 0]
../../source3/smbd/server.c:1741(main)
Jun 21 23:32:32 debian-dell smbd[346]:? ?smbd version 4.17.12-Debian
started.
Jun 21 23:32:32 debian-dell smbd[346]:? ?Copyright Andrew Tridgell and
the Samba Team 1992-2022
Jun 21 23:32:32 debian-dell systemd[1]: Started smbd.service - Samba SMB
Daemon.
Jun 21 23:32:32 debian-dell smbd[346]: [2025/06/21 23:32:32.493490, 0]
../../source3/smbd/server.c:1097(smbd_open_one_s>
Jun 21 23:32:32 debian-dell smbd[346]:? ?smbd_open_one_socket:
open_socket_in failed: Cannot assign requested address
Jun 21 23:32:32 debian-dell systemd[1]: Reloading smbd.service - Samba
SMB Daemon...
Jun 21 23:32:32 debian-dell systemd[1]: Reloaded smbd.service - Samba
SMB Daemon.