Unifi Network - Setup Chromecast between VLANs with mDNS repeater

IMPORTANT: Since I can use the Chromecast between the LAN and IoT networks without any problems, I ended up not having to apply what I described below. But if you’re having problems with the Chromecast and you’re using an IoT vlan, what I’ve already looked up on the subject might help you.


You need a Unifi Security Gateway so you can use the config.gateway.json. Or in the case of a UDM I read somewhere that you can remove the interface you don’t want mDNS on from the state file: mnt/data/udapi-config/ubios-udapi-server/ubios-udapi-server.state (at your own risk because it is the config boot file).

About IGMP Snooping: With every network, for example LAN or IoT, it is possible to turn ON IGMP Snooping. I have turned this ON, which is preferable so that multicast streams are not sent to all ports. But it seems to help to turn this OFF if the Chromecast cannot be found for casting. So you will have to test this.

About the Multicast DNS/mDNS reflector gateway setting: Do not enable this setting on the USG because it seems the reflector will mirror mDNS packets into all other networks including WAN

About Firewall rules: I had a rule configured so the Chromecast could communicate from the IoT network to the LAN network, but it turned out not to be necessary. It even prevented detection of the Chromecast by other devices for casting. So I removed the rule and didn’t investigate further

Find the right interfaces

  1. Log in to the USG with an SSH connection. For example via Putty.
  2. Run the following on the CLI:
    show interfaces
  3. For the networks for which the mDNS repeater has to be switched on, check which interface it concerns.

For example, in my case the interfaces are eth1 for LAN and eth1.20 for IoT

Create config.gateway.json

  1. Log in to the Docker host where the Unifi Controller container runs with an SSH connection.
  2. The path ~/unifi/unifi/data/sites/default/ must exist. default is the id of the site. The id can be obtained by browsing to the Unifi Controller. The default address is:
    http://<IP DOCKER SERVER>:8080/

    In the address bar, the id will appear after /manage/site.

    If the site does not exist go to the Unifi Controller (use the old UI!) and just add a picture as a topology map. The folder structure is now created automatically. The topology map can then be deleted again via the Unifi Controller.

  3. Go to ~/unifi/unifi/data/sites/default/ and run:
    sudo nano config.gateway.json
  4. Put the code below in it:
      "service": {
     "mdns": {
       "repeater": {
         "interface": [

Adjust the following:

“eth1”, “eth1.20”
Replace with the interfaces of the networks

Without the reflector part (line 4) it seems not to work. Unfortunately I couldn’t find much more information. Since the reflector part is set in the configuration by the USG itself when the repeater is switched ON via the CLI, it seems not to do any harm. But make your own choice based on this information.

Exit Nano (CTRL-X) and save the changes.

Apply Settings

Now go to the Unifi Controller and apply the settings:

  • Old UI (Unifi Controller < 6):
    • Open the UniFi Controller and go to Devices. Click on the USG, then Configuration (gear icon). Expand Manage Device and click on the Provision button (under Force provision)
  • New UI:
    • Open the UniFi Controller and go to Devices. Click on the USG, then Settings (gear icon). Expand Manage and go to Trigger Provision and click on Trigger Provision

Read other notes


    No comments found for this note.

    Join the discussion for this note on this ticket. Comments appear on this page instantly.


    Notes mentioning this note

    Notes Graph