{"id":1486,"date":"2022-02-14T08:55:16","date_gmt":"2022-02-14T14:55:16","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=1486"},"modified":"2022-07-23T17:34:19","modified_gmt":"2022-07-23T22:34:19","slug":"mdns-across-unifi-vlans","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=1486","title":{"rendered":"MDNS Across Unifi VLANs"},"content":{"rendered":"\n<p>I started working on some hardware projects related to home assistant using the ESP8266. in working on these I learned that the ESP devices use mDNS to advertise their hostnames for communicating with them. My devices however are on a separate VLAN that&#8217;s unable to communicate with the internet, and that VLAN was also blocking the mDNS updates from making it through to home assistant, keeping it from being able to know the hostnames. I could use static IPs for this, however I want to avoid locking all my little smart devices to static IPs.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Getting those mDNS updates across the VLANs takes two steps. It starts with enabling the mDNS repeater in the Unifi controller. This repeater however doesn&#8217;t work fully across VLANs without a little magic.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"508\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-2-1024x508.png\" alt=\"\" class=\"wp-image-1564\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-2-1024x508.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-2-300x149.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-2-768x381.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/02\/image-2.png 1291w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Turn on the mDNS Repeater<\/figcaption><\/figure>\n\n\n\n<p>The magic comes in the form of a LAN_IN firewall rule that allows through those mDNS packets between the VLANs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"893\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/image-6-1024x893.png\" alt=\"\" class=\"wp-image-1403\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/image-6-1024x893.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/image-6-300x262.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/image-6-768x670.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/01\/image-6.png 1067w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Magic Networking Firewall Rule<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>This ended up working well. The mDNS updates from my ESPHome devices started making it through to the VLAN hosting my home assistant server. I was able to ping the devices using their hostnames and from there also configure home assistant to use the hostnames instead of IP addresses. This lets me avoid setting all my ESPhome devices to static IPs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"resources\">Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/community.ui.com\/questions\/mDNS-across-LAN-VLANs-how-to-unblock\/347e7925-569a-49f3-85ec-cab4a5655c01\">Unifi Forum Post about mDNS Unblocking<\/a><\/li><li><a href=\"https:\/\/community.ui.com\/questions\/Unifi-mdns-repeater-not-working-across-VLANs\/b47199a0-5e7e-4caf-a8c6-d3c9c56f1e27\">Unifi Forum Post about mDNS Repeater<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I started working on some hardware projects related to home assistant using the ESP8266. in working on these I learned that the ESP devices use mDNS to advertise their hostnames for communicating with them. My devices however are on a separate VLAN that&#8217;s unable to communicate with the internet, and that VLAN was also blocking &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=1486\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MDNS Across Unifi VLANs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9],"tags":[74,39,80,67,49,35],"class_list":["post-1486","post","type-post","status-publish","format-standard","hentry","category-how-to","category-networking","tag-esphome","tag-home-assistant","tag-mdns","tag-network","tag-smart-home","tag-unifi"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1486"}],"version-history":[{"count":9,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1486\/revisions"}],"predecessor-version":[{"id":1588,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/1486\/revisions\/1588"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}