{"id":2064,"date":"2022-07-25T17:33:00","date_gmt":"2022-07-25T22:33:00","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=2064"},"modified":"2022-07-23T17:34:10","modified_gmt":"2022-07-23T22:34:10","slug":"fixing-the-unifi-mdns-repeater","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=2064","title":{"rendered":"Fixing the Unifi MDNS Repeater"},"content":{"rendered":"\n<p>I <a href=\"https:\/\/lab.rapternet.us\/?p=1486\">managed to get MDNS working <\/a>earlier this year to enable my ESPHome projects to avoid having all static IP addresses and let home assistant auto-detect them. However&#8230; after some firewall tweaking recently, it all broke. So it was time again to figure out how to get MDNS to work in the Unifi system.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I started by digging into the GUI to try and find the MDNS repeater option that I had enabled last time. It no longer exists.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"99\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-4-1024x99.png\" alt=\"\" class=\"wp-image-2076\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-4-1024x99.png 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-4-300x29.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-4-768x74.png 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-4.png 1385w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Normally would be between Dynamic DNS and SIP<\/figcaption><\/figure>\n\n\n\n<p>That lead me to needing to hack the config.gateway.json file on the controller and synchronize it to the USG that I&#8217;m running. In order to do that, I need a bit of information about my interfaces that are in use for all the VLANs. I SSH&#8217;d into my USG and ran the &#8220;show interfaces&#8221; command to get the VLAN and interface IDs for them.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"363\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-5.png\" alt=\"\" class=\"wp-image-2077\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-5.png 610w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-5-300x179.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><figcaption>Checking Interface Names<\/figcaption><\/figure>\n\n\n\n<p>Once I got all the interface names from the USG, I put them into the config file as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"405\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image.png\" alt=\"\" class=\"wp-image-2065\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image.png 709w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-300x171.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><figcaption>Initial Configuration for the MDNS Repeater<\/figcaption><\/figure>\n\n\n\n<p>However I ran into a small problem, once I tried to force provision with this configuration. It got into a loop and never finished. I checked \/var\/log\/unifi\/server.log and found that I might have expected it to handle more interfaces than it could.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Commit failed\n, failure=1, success=1}, DELETE={failure=0, success=1}, SESSION_ID=b66a9df63d75b655eea730fb8d, SET={failure=0, success=1}}\n[2022-07-23T02:38:34,858] &lt;inform-4> ERROR inform - [commit errors] dev[b4:fb:e4:2f:15:61], {COMMIT={error=\ufffd[ service mdns repeater ]\nCannot configure more than five interfaces.<\/pre>\n\n\n\n<p>Now that I know that its limited to 5 interfaces, I updated the configuration to only support my IOT VLANs and the base VLAN in hopes that it would be the right amount of coverage.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"303\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-3.png\" alt=\"\" class=\"wp-image-2071\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-3.png 816w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-3-300x111.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/07\/image-3-768x285.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Slimmed Down MDNS Repeater Settings<\/figcaption><\/figure>\n\n\n\n<p>After that, force provision (or for me, since the provision loop never ended, it just ended up working correctly after saving the file) and everything should be good to go. The MDNS repeater is back online and functioning. I&#8217;m still curious why ubiquity removed the MDNS repeater option from the GUI, and I hope they don&#8217;t remove the capability all together since its very useful with the small ESP devices, WLED, etc.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/community.ui.com\/questions\/mDNS-repeater-on-USG\/4d1bd073-3359-4a32-8cbe-84633af0ef03\">Unifi Forums Posting on MDNS<\/a><\/li><li><a href=\"https:\/\/www.reddit.com\/r\/Ubiquiti\/comments\/f1gt2j\/comment\/)\/\">Reddit posting on the topic<\/a><\/li><li><a href=\"https:\/\/help.ui.com\/hc\/en-us\/articles\/215458888-UniFi-USG-Advanced-Configuration-Using-config-gateway-json\">Creating config.gateway.json<\/a><\/li><li><a href=\"https:\/\/help.ui.com\/hc\/en-us\/articles\/115004872967\">Finding the unifi base dir for creating config.gateway.json<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I managed to get MDNS working earlier this year to enable my ESPHome projects to avoid having all static IP addresses and let home assistant auto-detect them. However&#8230; after some firewall tweaking recently, it all broke. So it was time again to figure out how to get MDNS to work in the Unifi system.<\/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-2064","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\/2064","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=2064"}],"version-history":[{"count":8,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/2064\/revisions"}],"predecessor-version":[{"id":2079,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/2064\/revisions\/2079"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}