home-assistant / addons

:heavy_plus_sign: Docker add-ons for Home Assistant
https://home-assistant.io/hassio/
Apache License 2.0
1.53k stars 1.48k forks source link

Can't start Samba add-on when there is a point-to-point network #3672

Closed DAVe3283 closed 1 month ago

DAVe3283 commented 3 months ago

Describe the issue you are experiencing

I have 2 network cards in my Home Assistant, one is connected to my LAN, and the other is a point-to-point network (192.168.90.0/31) connected to a device sharing unencrypted serial I want to keep separate from my LAN). That all works fine.

But when there is a /31 subnet, the Samba add-on can't start. I believe this is because it asks for the broadcast address of the subnet, and a /31 has no broadcast address (see RFC3021 section 2.2).

While I recognize I could change the dedicated network to a /30, I would prefer an option to disable specific interfaces in the Samba add-on. (Or perhaps only enable specific interfaces?)

That would not only solve this problem, but would go a step beyond the list of allowed hosts to secure a Home Assistant install with multiple connected networks, as users could only have SMB on selected network interfaces.

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

Samba share

What is the version of the add-on?

12.3.1

Steps to reproduce the issue

  1. Add more than one network interface to Home Assistant
  2. Set one of them to static IP using a point-to-point subnet (e.g. 192.168.90.0/31)
  3. Attempt to start the Samba share add-on, and it will fail

System Health information

System Information

version core-2024.6.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.33-haos
arch x86_64
timezone America/Boise
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4959 Installed Version | 1.34.0 Stage | running Available Repositories | 1394 Downloaded Repositories | 7
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 62.3 GB disk_used | 25.1 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | Samba share (12.3.1), Mosquitto broker (6.4.1), SQLite Web (4.1.2), Studio Code Server (5.15.0), InfluxDB (5.0.0), Grafana (10.0.0), Z-Wave JS UI (3.8.4), ESPHome (2024.6.4), Advanced SSH & Web Terminal (18.0.0), Grocy (0.21.0)
keymaster zwave_integration | zwave_js -- | -- network_status | on
Dashboards dashboards | 3 -- | -- resources | 5 views | 17 mode | storage
Recorder oldest_recorder_run | May 30, 2024 at 5:59 PM -- | -- current_recorder_run | June 28, 2024 at 10:58 AM estimated_db_size | 2255.73 MiB database_engine | sqlite database_version | 3.44.2

Anything in the Supervisor logs that might be useful for us?

No response

Anything in the add-on logs that might be useful for us?

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-smbd: starting
[12:57:20] INFO: Hostname: HAss
[12:57:20] INFO: Interfaces: enp6s19 enp6s18 
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file.
Added user hassio.
s6-rc: info: service init-smbd successfully started
s6-rc: info: service smbd: starting
s6-rc: info: service smbd successfully started
s6-rc: info: service nmbd: starting
s6-rc: info: service nmbd successfully started
s6-rc: info: service legacy-services: starting
smbd version 4.18.9 started.
Copyright Andrew Tridgell and the Samba Team 1992-2023
INFO: Profiling support unavailable in this build.
nmbd version 4.18.9 started.
Copyright Andrew Tridgell and the Samba Team 1992-2023
make_subnet: Failed to open nmb bcast socket on interface 192.168.90.0 for port 137: Address not available
exit_daemon: daemon failed to start: NMBD failed when creating subnet lists, error code 13
[12:57:21] INFO: Service nmbd exited with code 1 (by signal 0)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nmbd: stopping
s6-rc: info: service nmbd successfully stopped
s6-rc: info: service smbd: stopping
[12:57:21] INFO: Service smbd exited with code 256 (by signal 15)
s6-rc: info: service smbd successfully stopped
s6-rc: info: service init-smbd: stopping
s6-rc: info: service init-smbd successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Additional information

No response

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

DAVe3283 commented 2 months ago

This issues still exists for me.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Larnak23 commented 2 weeks ago

Hello I have the same issue

s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service nmbd: stopping Got SIGTERM: going down... [19:12:55] INFO: Service nmbd exited with code 0 (by signal 0) s6-rc: info: service nmbd successfully stopped s6-rc: info: service smbd: stopping [19:12:56] INFO: Service smbd exited with code 256 (by signal 15) s6-rc: info: service smbd successfully stopped s6-rc: info: service init-smbd: stopping s6-rc: info: service init-smbd successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-smbd: starting [19:12:59] INFO: Hostname: homeassistant [19:12:59] INFO: Interfaces: end0 tdbsam_open: Converting version 0.0 database to version 4.0. tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file. Added user home. s6-rc: info: service init-smbd successfully started s6-rc: info: service smbd: starting s6-rc: info: service smbd successfully started s6-rc: info: service nmbd: starting s6-rc: info: service nmbd successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started smbd version 4.18.9 started. Copyright Andrew Tridgell and the Samba Team 1992-2023 nmbd version 4.18.9 started. Copyright Andrew Tridgell and the Samba Team 1992-2023 INFO: Profiling support unavailable in this build.


Samba name server HOMEASSISTANT is now a local master browser for workgroup WORKGROUP on subnet 192.168.X.XX