From 946a187277009b7d2cbfabb6c073211a63e104ed Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 5 May 2020 09:44:54 +0200 Subject: [PATCH] Add more trouble shooting hints for mDNS (#13291) * Add more trouble shooting hints for mDNS * Update discovery.markdown * Apply suggestions from code review Co-authored-by: Jakob Reiter * Tweak Co-authored-by: Jakob Reiter --- source/_integrations/discovery.markdown | 27 ++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/source/_integrations/discovery.markdown b/source/_integrations/discovery.markdown index 278e6413c4d..27985eb2a3a 100644 --- a/source/_integrations/discovery.markdown +++ b/source/_integrations/discovery.markdown @@ -100,9 +100,34 @@ Valid values for enable are: ### mDNS and UPnP -Home Assistant must be on the same network as the devices for UPnP discovery to work. +Home Assistant should be on the same network as the devices for mDNS and UPnP discovery to work. + When running Home Assistant Core in a [Docker container](/docs/installation/docker/) command line option `--net=host` or the compose file equivalent `network_mode: host` must be used to put it on the host's network, otherwise mDNS and UPnP will not work. +If mDNS is still not working: +- make sure there are no firewall rules blocking mDNS traffic. mDNS relies on sending and receiving UDP multicast packets on port 5353. +- mDNS traffic may not be forwarded correctly between the wired and wireless interfaces of a Wi-Fi AP or router + +#### mDNS forwarding +If it's not possible to have Home Assistant and the devices on the same network, mDNS forwarding can be enabled to allow mDNS discovery between networks. + +mDNS forwarding is a configurable option in some routers. It can also be called mDNS reflector or mDNS repeater, depending on the manufacturer. + +For a Linux server acting as router, set up avahi-reflector on the server to make mDNS work between the networks: + +{% raw %} +```text +# Install the Avahi-daemon +sudo apt-get install avahi-daemon +# Turn on the reflector. Go into /etc/avahi/avahi-daemon.conf and change the reflector section to: + [reflector] + enable-reflector=yes + reflect-ipv=no +# (re)start the Avahi daemon to reload config +sudo service avahi-daemon restart +``` +{% endraw %} + ### Windows #### 64-bit Python