home-assistant / operating-system

:beginner: Home Assistant Operating System
Apache License 2.0
4.71k stars 951 forks source link

Can't change default network adapter nor choose network adapter for WOL integration #3453

Closed StijnWolf closed 3 weeks ago

StijnWolf commented 1 month ago

Describe the issue you are experiencing

I've been using home assistant for the past few years and love it. I use the Wake On Lan integration daily with the following configuration:

switch:
    - platform: wake_on_lan
      mac: "00:11:22:33:44:55"
      name: "Stijn PC"
      host: "192.168.x.x"
      turn_off:
        - service: shell_command.turn_off_stijn_desktop_windows
        - service: shell_command.turn_off_stijn_desktop_linux
shell_command:
  reboot_stijn_desktop_linux: "ssh -i /config/ssh_keys/id_rsa_homeassistant -o 'StrictHostKeyChecking=no' homeassistant@192.168.x.x sudo poweroff --reboot"
  reboot_stijn_desktop_windows: "ssh -i /config/ssh_keys/id_rsa_homeassistant -o 'StrictHostKeyChecking=no' rpc_user@192.168.x.x shutdown /r"
  turn_off_stijn_desktop_linux: "ssh -i /config/ssh_keys/id_rsa_homeassistant -o 'StrictHostKeyChecking=no' homeassistant@192.168.x.x sudo poweroff"
  turn_off_stijn_desktop_windows: "ssh -i /config/ssh_keys/id_rsa_homeassistant -o 'StrictHostKeyChecking=no' rpc_user@192.168.x.x shutdown /s"

This has been working perfectly fine, but I recently introduced an extra router to my setup, specifically for VR streaming. So the server is still connected to the other router, while the new router is connected to the old one and my gaming pc is connected to the new router; I put a new router between the gaming pc and old router. This broke my WOL integration in HA since the gaming PC is now connected to a different subnet. As a countermeasure I decided to buy a USB Wi-Fi dongle and pass it to my HAOS VM. I'm able to connect my HA instance to the same router as my pc via the Wi-Fi dongle, but here's the kicker. Home Assistant doesn't seem to send the WOL packet to all network adapters, but only the default one.

This means that while I've configured everything correctly, the package won't get sent to the right adapter. I searched around for changing the default network adapter using nmcli (like in this thread), but was then greeted with the following error:

Warning: nmcli (1.46.0) and NetworkManager (1.44.2) versions don't match. Restarting NetworkManager is advised.
Error: Failed to modify connection 'Supervisor enp1s0': connection.autoconnect-ports: unknown property

I also tried using the Wi-Fi adapter as the only network interface in HA, and low and behold, the magic packet gets sent properly! Unfortunately I need the other network adapters so this solution isn't viable for me, but simply confirmed my suspicions.

There are two possible solutions to my problem as far as I'm aware:

  1. Being able to set the used network adapter in the Wake On Lan integration
  2. Being able to change my default network adapter in Settings > System > Network.

What operating system image do you use?

generic-x86-64 (Generic UEFI capable x86-64 systems)

What version of Home Assistant Operating System is installed?

Home Assistant OS 12.4

Did the problem occur after upgrading the Operating System?

No

Hardware details

HAOS vm running via QEMU/KVM with virt-manager.

Specs:

CPU: Intel I5 6600k RAM: 16gb DDR4@2400mhz Storage: 1TB m.2 ssd GPU: none PSU: 650W silverstone (don't know the model)

OS: Ubuntu Desktop 22.04

Steps to reproduce the issue

  1. Have a separate network with a device to be used with Wake On Lan
  2. Add network adapter connected to said network to HA
  3. Ensure the new adapter is not the default network adapter in Settings > System > Network
  4. Try sending WOL packet to device
  5. Sending WOL packet to device does not work
  6. Try changing default network adapter to the new network not possible for me
  7. Sending WOL packet to device works ...

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

2024-07-01 12:54:10.631 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state initialize
2024-07-01 12:54:10.632 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-07-01 12:54:10.632 INFO (MainThread) [__main__] Setting up Supervisor
2024-07-01 12:54:14.788 INFO (MainThread) [supervisor.api] Starting API on 172.30.32.2
2024-07-01 12:54:14.863 INFO (MainThread) [supervisor.hardware.monitor] Started Supervisor hardware monitor
2024-07-01 12:54:14.864 INFO (MainThread) [supervisor.dbus.manager] Connected to system D-Bus.
2024-07-01 12:54:14.864 INFO (MainThread) [supervisor.dbus.agent] Load dbus interface io.hass.os
2024-07-01 12:54:14.864 INFO (MainThread) [supervisor.dbus.hostname] Load dbus interface org.freedesktop.hostname1
2024-07-01 12:54:14.865 INFO (MainThread) [supervisor.dbus.logind] Load dbus interface org.freedesktop.login1
2024-07-01 12:54:14.865 INFO (MainThread) [supervisor.dbus.network] Load dbus interface org.freedesktop.NetworkManager
2024-07-01 12:54:14.865 INFO (MainThread) [supervisor.dbus.rauc] Load dbus interface de.pengutronix.rauc
2024-07-01 12:54:14.865 INFO (MainThread) [supervisor.dbus.resolved] Load dbus interface org.freedesktop.resolve1
2024-07-01 12:54:14.865 INFO (MainThread) [supervisor.dbus.systemd] Load dbus interface org.freedesktop.systemd1
2024-07-01 12:54:14.866 INFO (MainThread) [supervisor.dbus.timedate] Load dbus interface org.freedesktop.timedate1
2024-07-01 12:54:14.961 INFO (MainThread) [supervisor.host.services] Updating service information
2024-07-01 12:54:14.963 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
2024-07-01 12:54:14.965 WARNING (SyncWorker_0) [supervisor.host.sound] Can't update PulseAudio data: Failed to connect to pulseaudio server
2024-07-01 12:54:15.090 INFO (MainThread) [supervisor.host.network] Updating local network information
2024-07-01 12:54:15.093 INFO (MainThread) [supervisor.host.network] Updating local network information
2024-07-01 12:54:21.488 INFO (MainThread) [supervisor.host.network] Updating local network information
2024-07-01 12:54:21.519 INFO (MainThread) [supervisor.host.apparmor] Loading AppArmor Profiles: {'hassio-supervisor'}
2024-07-01 12:54:21.528 INFO (MainThread) [supervisor.docker.monitor] Started docker events monitor
2024-07-01 12:54:21.528 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
2024-07-01 12:54:25.654 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/amd64-hassio-cli with version 2024.05.0
2024-07-01 12:54:25.689 INFO (MainThread) [supervisor.plugins.cli] Starting CLI plugin
2024-07-01 12:54:25.700 INFO (SyncWorker_0) [supervisor.docker.manager] Cleaning hassio_cli application
2024-07-01 12:54:26.018 INFO (MainThread) [supervisor.docker.cli] Starting CLI ghcr.io/home-assistant/amd64-hassio-cli with version 2024.05.0 - 172.30.32.5
2024-07-01 12:54:26.026 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/amd64-hassio-dns with version 2024.04.0
2024-07-01 12:54:26.043 INFO (MainThread) [supervisor.plugins.dns] Starting CoreDNS plugin
2024-07-01 12:54:26.046 INFO (SyncWorker_0) [supervisor.docker.manager] Cleaning hassio_dns application
2024-07-01 12:54:26.313 INFO (MainThread) [supervisor.docker.dns] Starting DNS ghcr.io/home-assistant/amd64-hassio-dns with version 2024.04.0 - 172.30.32.3
2024-07-01 12:54:26.313 INFO (MainThread) [supervisor.plugins.dns] Updated /etc/resolv.conf
2024-07-01 12:54:26.321 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/amd64-hassio-audio with version 2023.12.0
2024-07-01 12:54:26.332 INFO (MainThread) [supervisor.plugins.audio] Starting Audio plugin
2024-07-01 12:54:26.342 INFO (SyncWorker_0) [supervisor.docker.manager] Cleaning hassio_audio application
2024-07-01 12:54:26.583 INFO (MainThread) [supervisor.docker.audio] Starting Audio ghcr.io/home-assistant/amd64-hassio-audio with version 2023.12.0 - 172.30.32.4
2024-07-01 12:54:26.586 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/amd64-hassio-observer with version 2023.06.0
2024-07-01 12:54:26.598 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/amd64-hassio-multicast with version 2024.03.0
2024-07-01 12:54:26.608 INFO (MainThread) [supervisor.plugins.multicast] Starting Multicast plugin
2024-07-01 12:54:26.612 INFO (SyncWorker_0) [supervisor.docker.manager] Cleaning hassio_multicast application
2024-07-01 12:54:26.781 INFO (MainThread) [supervisor.docker.multicast] Starting Multicast ghcr.io/home-assistant/amd64-hassio-multicast with version 2024.03.0 - Host
2024-07-01 12:54:26.784 INFO (MainThread) [supervisor.homeassistant.secrets] Loaded 1 Home Assistant secrets
2024-07-01 12:54:26.789 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/qemux86-64-homeassistant with version 2024.6.4
2024-07-01 12:54:26.832 INFO (MainThread) [supervisor.os.manager] Detect Home Assistant Operating System 12.4 / BootSlot A
2024-07-01 12:54:27.179 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/core repository
2024-07-01 12:54:27.179 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/5c53de3b repository
2024-07-01 12:54:27.179 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/d5369777 repository
2024-07-01 12:54:27.180 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/a0d7b954 repository
2024-07-01 12:54:27.735 INFO (MainThread) [supervisor.store] Loading add-ons from store: 80 all - 80 new - 0 remove
2024-07-01 12:54:27.752 INFO (MainThread) [supervisor.addons.manager] Found 3 installed add-ons
2024-07-01 12:54:27.765 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/ssh/amd64 with version 18.0.0
2024-07-01 12:54:27.765 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/amd64-addon-configurator with version 5.8.0
2024-07-01 12:54:27.769 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/glances/amd64 with version 0.21.1
2024-07-01 12:54:27.793 INFO (MainThread) [supervisor.backups.manager] Found 33 backup files
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.discovery] Loaded 0 messages
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.ingress] Loaded 7 ingress sessions
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state setup
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/system
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.checks.base] Run check for detached_addon_missing/addon
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.checks.base] Run check for detached_addon_removed/addon
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.check] System checks complete
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state setup
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.jobs] 'ResolutionFixup.run_autofix' blocked from execution, system is not running - setup
2024-07-01 12:54:27.816 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state setup
2024-07-01 12:54:27.817 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-07-01 12:54:27.817 INFO (MainThread) [__main__] Running Supervisor
2024-07-01 12:54:27.822 INFO (MainThread) [supervisor.os.manager] Rauc: A - marked slot kernel.0 as good
2024-07-01 12:54:27.831 INFO (MainThread) [supervisor.addons.manager] Phase 'initialize' starting 0 add-ons
2024-07-01 12:54:27.837 INFO (MainThread) [supervisor.addons.manager] Phase 'system' starting 0 add-ons
2024-07-01 12:54:27.837 INFO (MainThread) [supervisor.addons.manager] Phase 'services' starting 2 add-ons
2024-07-01 12:54:27.891 INFO (SyncWorker_2) [supervisor.docker.manager] Cleaning addon_a0d7b954_ssh application
2024-07-01 12:54:28.090 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ghcr.io/hassio-addons/ssh/amd64 with version 18.0.0
2024-07-01 12:54:28.111 INFO (SyncWorker_3) [supervisor.docker.manager] Cleaning addon_a0d7b954_glances application
2024-07-01 12:54:28.266 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on ghcr.io/hassio-addons/glances/amd64 with version 0.21.1
2024-07-01 12:54:33.278 INFO (MainThread) [supervisor.core] Start Home Assistant Core
2024-07-01 12:54:33.310 INFO (SyncWorker_3) [supervisor.docker.manager] Starting homeassistant
2024-07-01 12:54:33.420 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-07-01 12:54:35.446 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state startup
2024-07-01 12:54:35.447 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-07-01 12:54:38.437 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-07-01 12:54:38.441 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
2024-07-01 12:54:43.458 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to STARTING
2024-07-01 12:54:48.474 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to RUNNING
2024-07-01 12:54:48.475 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-07-01 12:54:48.475 INFO (MainThread) [supervisor.addons.manager] Phase 'application' starting 1 add-ons
2024-07-01 12:54:48.501 INFO (SyncWorker_3) [supervisor.docker.manager] Cleaning addon_core_configurator application
2024-07-01 12:54:48.771 INFO (MainThread) [supervisor.docker.addon] Starting Docker add-on homeassistant/amd64-addon-configurator with version 5.8.0
2024-07-01 12:55:18.862 INFO (MainThread) [supervisor.misc.tasks] All core tasks are scheduled
2024-07-01 12:55:18.862 INFO (MainThread) [supervisor.core] Supervisor is up and running
2024-07-01 12:55:18.862 INFO (MainThread) [supervisor.host.info] Updating local host information
2024-07-01 12:55:18.863 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
2024-07-01 12:55:18.863 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state running
2024-07-01 12:55:18.863 INFO (MainThread) [supervisor.resolution.checks.base] Run check for docker_config/system
2024-07-01 12:55:18.863 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2024-07-01 12:55:18.863 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_failed/dns_server
2024-07-01 12:55:19.121 INFO (MainThread) [supervisor.host.services] Updating service information
2024-07-01 12:55:19.124 INFO (MainThread) [supervisor.host.network] Updating local network information
2024-07-01 12:55:19.175 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
2024-07-01 12:55:19.180 INFO (MainThread) [supervisor.host.manager] Host information reload completed

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

2024-07-01 10:54:26.537 homeassistant kernel: audit: type=1327 audit(1719831266.536:155): proctitle=2F7573722F7362696E2F69707461626C6573002D2D77616974002D74006E6174002D4E00444F434B45525F4F5554505554
2024-07-01 10:54:26.538 homeassistant kernel: audit: type=1325 audit(1719831266.537:156): table=nat:3 family=2 entries=2 op=nft_register_chain pid=1459 subj=unconfined comm="iptables"
2024-07-01 10:54:26.538 homeassistant kernel: audit: type=1300 audit(1719831266.537:156): arch=c000003e syscall=46 success=yes exit=396 a0=3 a1=7ffe988c2510 a2=0 a3=7ffe988c24fc items=0 ppid=451 pid=1459 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-nft-multi" subj=unconfined key=(null)
2024-07-01 10:54:26.538 homeassistant kernel: audit: type=1327 audit(1719831266.537:156): proctitle=2F7573722F7362696E2F69707461626C6573002D2D77616974002D74006E6174002D49004F5554505554002D64003132372E302E302E3131002D6A00444F434B45525F4F5554505554
2024-07-01 10:54:26.540 homeassistant kernel: audit: type=1325 audit(1719831266.539:157): table=nat:4 family=2 entries=1 op=nft_register_chain pid=1461 subj=unconfined comm="iptables"
2024-07-01 10:54:26.540 homeassistant kernel: audit: type=1300 audit(1719831266.539:157): arch=c000003e syscall=46 success=yes exit=100 a0=3 a1=7ffc74e61960 a2=0 a3=7ffc74e6194c items=0 ppid=451 pid=1461 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-nft-multi" subj=unconfined key=(null)
2024-07-01 10:54:26.540 homeassistant kernel: audit: type=1327 audit(1719831266.539:157): proctitle=2F7573722F7362696E2F69707461626C6573002D2D77616974002D74006E6174002D4E00444F434B45525F504F5354524F5554494E47
2024-07-01 10:54:26.542 homeassistant kernel: audit: type=1325 audit(1719831266.540:158): table=nat:5 family=2 entries=2 op=nft_register_chain pid=1462 subj=unconfined comm="iptables"
2024-07-01 10:54:26.554 homeassistant kernel: eth0: renamed from veth8cdd428
2024-07-01 10:54:26.562 homeassistant NetworkManager[313]: <info>  [1719831266.5628] device (veth1b3ae0a): carrier: link connected
2024-07-01 10:54:26.751 homeassistant systemd[1]: Started libcontainer container c064149b455ad7a8ba238ec1b603a2e2f0236b860771f7bf6558a13e533f9bfc.
2024-07-01 10:54:27.352 homeassistant systemd[1]: Bluetooth service was skipped because of an unmet condition check (ConditionPathIsDirectory=/sys/class/bluetooth).
2024-07-01 10:54:27.971 homeassistant systemd[1]: var-lib-docker-overlay2-7dc14610747d0bbf102a4d0475ced5568689fb9cc7e66bfd636067522b3467af\x2dinit-merged.mount: Deactivated successfully.
2024-07-01 10:54:27.971 homeassistant systemd[1]: mnt-data-docker-overlay2-7dc14610747d0bbf102a4d0475ced5568689fb9cc7e66bfd636067522b3467af\x2dinit-merged.mount: Deactivated successfully.
2024-07-01 10:54:27.989 homeassistant systemd[1]: var-lib-docker-overlay2-7dc14610747d0bbf102a4d0475ced5568689fb9cc7e66bfd636067522b3467af-merged.mount: Deactivated successfully.
2024-07-01 10:54:27.989 homeassistant systemd[1]: mnt-data-docker-overlay2-7dc14610747d0bbf102a4d0475ced5568689fb9cc7e66bfd636067522b3467af-merged.mount: Deactivated successfully.
2024-07-01 10:54:28.033 homeassistant dockerd[451]: time="2024-07-01T10:54:28.033396378Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:172.30.232.2:37894" dns-server="udp:192.168.1.178:53" error="read udp 172.30.232.2:37894->192.168.1.178:53: i/o timeout" question=";version.home-assistant.io.\tIN\t AAAA" spanID=c02ff577deaae2cd traceID=ffd2cbc82c851b24ec05c4e122cd18f9
2024-07-01 10:54:28.034 homeassistant dockerd[451]: time="2024-07-01T10:54:28.034301592Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:172.30.232.2:49606" dns-server="udp:192.168.1.178:53" error="read udp 172.30.232.2:49606->192.168.1.178:53: i/o timeout" question=";version.home-assistant.io.\tIN\t A" spanID=ba46b84ddc2c7d4e traceID=8f533d0c899d2d5aa6a80e118d6b8a41
2024-07-01 10:54:28.056 homeassistant systemd[1]: Started libcontainer container d3b22a48bcdfe45c048835277a1f36b047e98d2e234459674516d4f6a83ebccf.
2024-07-01 10:54:28.228 homeassistant systemd[1]: Started libcontainer container 1b421aa7cbf33e828f3c1a5d0ffd5f342423aaee5ae36675bc47ba69b35ca989.
2024-07-01 10:54:28.557 homeassistant systemd[1]: docker-1b421aa7cbf33e828f3c1a5d0ffd5f342423aaee5ae36675bc47ba69b35ca989.scope: Deactivated successfully.
2024-07-01 10:54:28.577 homeassistant dockerd[451]: time="2024-07-01T10:54:28.577932247Z" level=info msg="ignoring event" container=1b421aa7cbf33e828f3c1a5d0ffd5f342423aaee5ae36675bc47ba69b35ca989 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
2024-07-01 10:54:31.520 homeassistant systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
2024-07-01 10:54:33.392 homeassistant systemd[1]: Started libcontainer container 6846a87f5f15cbfc3bd2ef3b33befdadc68463da0b1b12888d9dadf16b34703b.
2024-07-01 10:54:33.403 homeassistant kernel: kauditd_printk_skb: 64 callbacks suppressed
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1334 audit(1719831273.402:183): prog-id=50 op=LOAD
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1300 audit(1719831273.402:183): arch=c000003e syscall=321 success=yes exit=15 a0=5 a1=c00016d928 a2=78 a3=0 items=0 ppid=2450 pid=2460 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="runc" exe="/usr/bin/runc" subj=unconfined key=(null)
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1327 audit(1719831273.402:183): proctitle=72756E63002D2D726F6F74002F7661722F72756E2F646F636B65722F72756E74696D652D72756E632F6D6F6279002D2D6C6F67002F72756E2F636F6E7461696E6572642F696F2E636F6E7461696E6572642E72756E74696D652E76322E7461736B2F6D6F62792F36383436613837663566313563626663336264326566336233
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1334 audit(1719831273.403:184): prog-id=51 op=LOAD
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1300 audit(1719831273.403:184): arch=c000003e syscall=321 success=yes exit=17 a0=5 a1=c00016d6c0 a2=78 a3=0 items=0 ppid=2450 pid=2460 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="runc" exe="/usr/bin/runc" subj=unconfined key=(null)
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1327 audit(1719831273.403:184): proctitle=72756E63002D2D726F6F74002F7661722F72756E2F646F636B65722F72756E74696D652D72756E632F6D6F6279002D2D6C6F67002F72756E2F636F6E7461696E6572642F696F2E636F6E7461696E6572642E72756E74696D652E76322E7461736B2F6D6F62792F36383436613837663566313563626663336264326566336233
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1334 audit(1719831273.403:185): prog-id=51 op=UNLOAD
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1300 audit(1719831273.403:185): arch=c000003e syscall=3 success=yes exit=0 a0=11 a1=0 a2=0 a3=0 items=0 ppid=2450 pid=2460 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="runc" exe="/usr/bin/runc" subj=unconfined key=(null)
2024-07-01 10:54:33.403 homeassistant kernel: audit: type=1327 audit(1719831273.403:185): proctitle=72756E63002D2D726F6F74002F7661722F72756E2F646F636B65722F72756E74696D652D72756E632F6D6F6279002D2D6C6F67002F72756E2F636F6E7461696E6572642F696F2E636F6E7461696E6572642E72756E74696D652E76322E7461736B2F6D6F62792F36383436613837663566313563626663336264326566336233
2024-07-01 10:54:33.404 homeassistant kernel: audit: type=1334 audit(1719831273.403:186): prog-id=50 op=UNLOAD
2024-07-01 10:54:35.935 homeassistant systemd[1]: Bluetooth service was skipped because of an unmet condition check (ConditionPathIsDirectory=/sys/class/bluetooth).
2024-07-01 10:54:35.948 homeassistant systemd[1]: Bluetooth service was skipped because of an unmet condition check (ConditionPathIsDirectory=/sys/class/bluetooth).
2024-07-01 10:54:35.951 homeassistant kernel: Bluetooth: Core ver 2.22
2024-07-01 10:54:35.952 homeassistant kernel: NET: Registered PF_BLUETOOTH protocol family
2024-07-01 10:54:35.952 homeassistant kernel: Bluetooth: HCI device and connection manager initialized
2024-07-01 10:54:35.952 homeassistant kernel: Bluetooth: HCI socket layer initialized
2024-07-01 10:54:35.952 homeassistant kernel: Bluetooth: L2CAP socket layer initialized
2024-07-01 10:54:35.952 homeassistant kernel: Bluetooth: SCO socket layer initialized
2024-07-01 10:54:44.882 homeassistant systemd[1]: systemd-hostnamed.service: Deactivated successfully.
2024-07-01 10:54:44.916 homeassistant kernel: kauditd_printk_skb: 5 callbacks suppressed
2024-07-01 10:54:44.916 homeassistant kernel: audit: type=1334 audit(1719831284.915:188): prog-id=14 op=UNLOAD
2024-07-01 10:54:44.916 homeassistant kernel: audit: type=1334 audit(1719831284.915:189): prog-id=13 op=UNLOAD
2024-07-01 10:54:44.916 homeassistant kernel: audit: type=1334 audit(1719831284.915:190): prog-id=12 op=UNLOAD
2024-07-01 10:54:44.968 homeassistant systemd[1]: systemd-timedated.service: Deactivated successfully.
2024-07-01 10:54:44.979 homeassistant kernel: audit: type=1334 audit(1719831284.978:191): prog-id=25 op=UNLOAD
2024-07-01 10:54:44.979 homeassistant kernel: audit: type=1334 audit(1719831284.978:192): prog-id=24 op=UNLOAD
2024-07-01 10:54:44.979 homeassistant kernel: audit: type=1334 audit(1719831284.978:193): prog-id=23 op=UNLOAD
2024-07-01 10:54:48.555 homeassistant systemd[1]: var-lib-docker-overlay2-04154aaff43e2b07e999a9abc14dc5771fc3c7449e0fdbcf826f9ea7e91e4247\x2dinit-merged.mount: Deactivated successfully.
2024-07-01 10:54:48.556 homeassistant systemd[1]: mnt-data-docker-overlay2-04154aaff43e2b07e999a9abc14dc5771fc3c7449e0fdbcf826f9ea7e91e4247\x2dinit-merged.mount: Deactivated successfully.
2024-07-01 10:54:48.593 homeassistant kernel: hassio: port 6(veth091ea2b) entered blocking state
2024-07-01 10:54:48.594 homeassistant kernel: hassio: port 6(veth091ea2b) entered disabled state
2024-07-01 10:54:48.594 homeassistant kernel: veth091ea2b: entered allmulticast mode
2024-07-01 10:54:48.594 homeassistant kernel: veth091ea2b: entered promiscuous mode
2024-07-01 10:54:48.594 homeassistant kernel: hassio: port 6(veth091ea2b) entered blocking state
2024-07-01 10:54:48.594 homeassistant kernel: hassio: port 6(veth091ea2b) entered forwarding state
2024-07-01 10:54:48.594 homeassistant kernel: audit: type=1700 audit(1719831288.590:194): dev=veth091ea2b prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
2024-07-01 10:54:48.594 homeassistant kernel: audit: type=1300 audit(1719831288.590:194): arch=c000003e syscall=44 success=yes exit=40 a0=d a1=c001ab0840 a2=28 a3=0 items=0 ppid=1 pid=451 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="dockerd" exe="/usr/bin/dockerd" subj=unconfined key=(null)
2024-07-01 10:54:48.594 homeassistant kernel: audit: type=1327 audit(1719831288.590:194): proctitle=2F7573722F62696E2F646F636B657264002D480066643A2F2F002D2D636F6E7461696E6572643D2F72756E2F636F6E7461696E6572642F636F6E7461696E6572642E736F636B
2024-07-01 10:54:48.594 homeassistant kernel: hassio: port 6(veth091ea2b) entered disabled state
2024-07-01 10:54:48.594 homeassistant NetworkManager[313]: <info>  [1719831288.5922] manager: (veth9ab41f8): new Veth device (/org/freedesktop/NetworkManager/Devices/20)
2024-07-01 10:54:48.597 homeassistant NetworkManager[313]: <info>  [1719831288.5949] manager: (veth091ea2b): new Veth device (/org/freedesktop/NetworkManager/Devices/21)
2024-07-01 10:54:48.661 homeassistant systemd[1]: Started libcontainer container 76fe034ad8cc46e6fe5d4d0c54bbc38481104b272a639955bc8cbde6ccf7bf68.
2024-07-01 10:54:48.672 homeassistant kernel: audit: type=1334 audit(1719831288.671:195): prog-id=53 op=LOAD
2024-07-01 10:54:48.742 homeassistant kernel: eth0: renamed from veth9ab41f8
2024-07-01 10:54:48.747 homeassistant kernel: hassio: port 6(veth091ea2b) entered blocking state
2024-07-01 10:54:48.747 homeassistant kernel: hassio: port 6(veth091ea2b) entered forwarding state
2024-07-01 10:54:48.747 homeassistant NetworkManager[313]: <info>  [1719831288.7478] device (veth091ea2b): carrier: link connected
2024-07-01 10:55:18.085 homeassistant systemd-resolved[306]: Using degraded feature set UDP instead of UDP+EDNS0 for DNS server 192.168.178.1.
2024-07-01 10:55:18.821 homeassistant systemd[1]: run-docker-runtime\x2drunc-moby-76fe034ad8cc46e6fe5d4d0c54bbc38481104b272a639955bc8cbde6ccf7bf68-runc.CV3yk4.mount: Deactivated successfully.
2024-07-01 10:55:18.875 homeassistant kernel: kauditd_printk_skb: 39 callbacks suppressed
2024-07-01 10:55:18.875 homeassistant kernel: audit: type=1334 audit(1719831318.871:209): prog-id=57 op=LOAD
2024-07-01 10:55:18.875 homeassistant kernel: audit: type=1334 audit(1719831318.871:210): prog-id=58 op=LOAD
2024-07-01 10:55:18.875 homeassistant kernel: audit: type=1334 audit(1719831318.873:211): prog-id=59 op=LOAD
2024-07-01 10:55:18.881 homeassistant systemd[1]: Starting Hostname Service...
2024-07-01 10:55:18.995 homeassistant systemd[1]: Started Hostname Service.
2024-07-01 10:55:19.002 homeassistant kernel: audit: type=1334 audit(1719831319.001:212): prog-id=60 op=LOAD
2024-07-01 10:55:19.002 homeassistant kernel: audit: type=1334 audit(1719831319.001:213): prog-id=61 op=LOAD
2024-07-01 10:55:19.003 homeassistant kernel: audit: type=1334 audit(1719831319.002:214): prog-id=62 op=LOAD
2024-07-01 10:55:19.010 homeassistant systemd[1]: Starting Time & Date Service...
2024-07-01 10:55:19.109 homeassistant systemd[1]: Started Time & Date Service.
2024-07-01 10:55:22.870 homeassistant dockerd[451]: time="2024-07-01T10:55:22.868648113Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:172.30.232.2:45623" dns-server="udp:192.168.1.178:53" error="read udp 172.30.232.2:45623->192.168.1.178:53: i/o timeout" question=";version.home-assistant.io.\tIN\t AAAA" spanID=6c691e7ab181b9cf traceID=0d0c2b26861801dd8f6adc2a2c859258
2024-07-01 10:55:22.870 homeassistant dockerd[451]: time="2024-07-01T10:55:22.868717322Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:172.30.232.2:57898" dns-server="udp:192.168.1.178:53" error="read udp 172.30.232.2:57898->192.168.1.178:53: i/o timeout" question=";version.home-assistant.io.\tIN\t A" spanID=92e12a79a390b54d traceID=1d6727e56321c02ef046554581a184e6
2024-07-01 10:55:25.370 homeassistant dockerd[451]: time="2024-07-01T10:55:25.369981740Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:172.30.232.2:45983" dns-server="udp:192.168.1.178:53" error="read udp 172.30.232.2:45983->192.168.1.178:53: i/o timeout" question=";version.home-assistant.io.\tIN\t A" spanID=7eb99118efd2b791 traceID=6234dc468c1d147e3d2a87a395f59c62
2024-07-01 10:55:25.372 homeassistant dockerd[451]: time="2024-07-01T10:55:25.370022247Z" level=error msg="[resolver] failed to query external DNS server" client-addr="udp:172.30.232.2:52337" dns-server="udp:192.168.1.178:53" error="read udp 172.30.232.2:52337->192.168.1.178:53: i/o timeout" question=";version.home-assistant.io.\tIN\t AAAA" spanID=98cf516358bc5c32 traceID=fbe4e1b054edb002bb5767d3d7d05b5d
2024-07-01 10:55:33.074 homeassistant kernel: audit: type=1334 audit(1719831333.072:215): prog-id=63 op=LOAD
2024-07-01 10:55:33.083 homeassistant systemd-timesyncd[440]: Network configuration changed, trying to establish connection.
2024-07-01 10:55:33.089 homeassistant systemd[1]: Started Journal Gateway Service.
2024-07-01 10:55:33.098 homeassistant systemd-timesyncd[440]: Contacted time server 162.159.200.1:123 (time.cloudflare.com).
2024-07-01 10:55:49.010 homeassistant systemd[1]: systemd-hostnamed.service: Deactivated successfully.
2024-07-01 10:55:49.042 homeassistant kernel: audit: type=1334 audit(1719831349.041:216): prog-id=59 op=UNLOAD
2024-07-01 10:55:49.042 homeassistant kernel: audit: type=1334 audit(1719831349.041:217): prog-id=58 op=UNLOAD
2024-07-01 10:55:49.042 homeassistant kernel: audit: type=1334 audit(1719831349.041:218): prog-id=57 op=UNLOAD
2024-07-01 10:55:49.138 homeassistant systemd[1]: systemd-timedated.service: Deactivated successfully.
2024-07-01 10:55:49.149 homeassistant kernel: audit: type=1334 audit(1719831349.148:219): prog-id=62 op=UNLOAD
2024-07-01 10:55:49.149 homeassistant kernel: audit: type=1334 audit(1719831349.149:220): prog-id=61 op=UNLOAD
2024-07-01 10:55:49.150 homeassistant kernel: audit: type=1334 audit(1719831349.149:221): prog-id=60 op=UNLOAD

System 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 Europe/Amsterdam
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4996 Installed Version | 1.34.0 Stage | running Available Repositories | 1385 Downloaded Repositories | 6
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 | 30.8 GB disk_used | 5.8 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 | File editor (5.8.0), Advanced SSH & Web Terminal (18.0.0), Glances (0.21.1)
Dashboards dashboards | 2 -- | -- resources | 3 views | 5 mode | storage
Recorder oldest_recorder_run | June 22, 2024 at 11:02 AM -- | -- current_recorder_run | July 1, 2024 at 12:54 PM estimated_db_size | 165.14 MiB database_engine | sqlite database_version | 3.44.2

Additional information

HA runs in a VM on a server running Ubuntu Desktop 22.04. My gaming PC and server are both hardwired to the same router. The gaming pc has a Windows (11) + Linux (Manjaro) dual boot, this doesn't seem to matter but should be mentioned nonetheless.

The most frustrating part of this is knowing that this can work, but doesn't. Other devices (such as my smartphone) are able to send a WOL packet just fine to my gaming pc, so I know that this issue boils down to HA not sending the packet to the right destination.

sairon commented 1 month ago

Currently using a multi-homed network setup is something that's rather unsupported in HA, and enabling configurability of the default network adapter is something that would need changes in multiple layers of the stack. We might consider it in the future but it's not a viable solution for your issue.

On the other hand, the way around it could be adding option to specify interface where the magic packet should be sent from. This is something that is available in the underlying wakeonlan library used by the integration so if the integration allowed to specify it, it could be a solution to your problem. So I rather suggest opening an issue in the Core repository asking for this feature.

StijnWolf commented 1 month ago

I made an attempt to write a custom_component to add this feature to the existing wakeonlan integration. Sadly I couldn't get the interface parameter in the wakeonlan library used by the integration to work. It'd succesfully execute the command but my target machine would still not receive a magic packet. I succesfully added a copy of the integration to my home assistant instance inside the custom_components folder, so I was able to add custom logic to the existing integration locally. Sadly the wakeonlan integration just didn't want to recognize my second network interface. I tried passing a hardcoded value for this parameter to no avail.

AFAIK this issue can't be supported by home assistant. I would've loved to make a merge request with my fix but the problem doesn't seem to be fixed by adding the interface parameter to the wakeonlan calls within the wakeonlan home assistant integration.

I confirmed my suspicions by writing a python script which uses wakeonlan on the server which runs the home assistant vm, and that worked as expected; the target machine receives the magic packet, but only if I add the interface parameter. This made me give up on the wakeonlan integration because I just couldn't figure out another probable cause than adding the interface parameter after this test.

I instead opted for a custom switch with very similar behavior using a custom binary sensor. My HA vm uses SSH to connect to the server hosting the HA vm, and then the server itself sends the magic packet to my target machine. This gives me the desired behavior for a wakeonlan switch. I'm happy I was able to build a solution myself, but am disappointed that it doesn't make use of the seemingly fitting wakeonlan integration.

I added my configuration as a file should it be of any use

wolpc.txt

I suppose this issue can be closed since I don't think this issue can be resolved within the wakeonlan integration and I've provided an alternative for my use case.