core icon indicating copy to clipboard operation
core copied to clipboard

DHCP discovery only works on the first interface

Open davidrapan opened this issue 8 months ago • 4 comments

The problem

Hi, I noticed that new fancy tool for browsing discoveries (DHCP) shows only devices from single subnet (My HA instance is connected to multiple VLANS). So, I tried to peak a little into the aiodhcpwatcher and it looks like it only ever listens on single interface.

What version of Home Assistant Core has the issue?

core-2025.5.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

DHCP discovery

Link to integration documentation on our website

https://www.home-assistant.io/integrations/dhcp/

davidrapan avatar May 08 '25 21:05 davidrapan

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (dhcp) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of dhcp can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign dhcp Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


dhcp documentation dhcp source (message by IssueLinks)

home-assistant[bot] avatar May 08 '25 21:05 home-assistant[bot]

So I was able to find what's going on. aiodhcpwatcher is using only conf.iface from scapy.config therefore it cannot capture packets anywhere else. So it "should" proly create multiple sockets using conf.ifaces.

davidrapan avatar May 08 '25 23:05 davidrapan

You're right — the dhcp discovery integration currently isn't aware of the full network configuration. At the moment, only Zeroconf and SSDP use the network integration to configure sockets.

If you're interested, we'd definitely consider a PR that extends DHCP discovery to use the network settings as well. That said, it's unlikely we'll add support for this ourselves unless a contributor steps up, since we typically don't go out of our way to support non-default network setups without community involvement.

bdraco avatar May 08 '25 23:05 bdraco

Hey @bdraco, technical question.. Should I do aiodhcpwatcher bump and changes in single PR or separately?

davidrapan avatar May 12 '25 19:05 davidrapan