User Tools

Site Tools


ubiquiti:igmp_proxy:sonos

This is an old revision of the document!


Ubiquiti - IGMP Proxy - Sonos

For Sonos on a dedicated network (VLAN), but to be able to control it from their main network.

Sonos relies heavily on IGMP.

  • IGMP only works on the same LAN and by design does not work across VLANs.
  • The solution is using an IGMP-Proxy to repeat the multicast traffic from VLAN the Sonos is on to the main LAN.

IGMP-Proxy Configuration

Prerequisites:

  • An always-on Unifi Controller.
  • Unifi Security Gateway.
  • Known SSH Credentials for the Controller & USG.
  • mDNS is Enabled.
  • IGMP Snooping Enabled on VLANs.
  • UPnP Enabled for only the IoT LAN.
  • Multicast Enhancements enabled on Wireless Networks.
  • LAN to WLAN Multicast & Broadcast Data is not blocked.

Create a config.gateway.json file

A config.gateway.json file is needed to be imported onto the Unifi Controller.

NOTE: This file is grabbed by the USG every-time it boots and allows you to run advanced features not yet supported by the Unifi GUI.

config.gateway.json
{
    "protocols": {
        "igmp-proxy": {
            "interface": {
                "eth1": {
                    "alt-subnet": "0.0.0.0/0",
                    "role": "upstream",
                    "threshold": "1"
                },
                "eth1.10": {
                    "alt-subnet": "0.0.0.0/0",
                    "role": "downstream",
                    "threshold": "1"
                }
            }
        }
    },
    "system": {
        "task-scheduler": {
            "task": {
                "igmpcheck": {
                    "executable": {
                        "path": "/config/igmpcheck.sh"
                    },
                    "interval": "5m"
                }
            }
        }
    }
}

NOTE: The file will need to be edited for your network setup and VLAN ids.

eth1 is the default LAN port on the USG.

  • eth1 = LAN, eth1.10 = VLAN 10, eth1.200 = VLAN 200
  • downstream = IoT LAN
  • upstream = Main LAN
  • The task-scheduer is to make sure the IGMP-Proxy is running every 5 minutes.
    • Unifi has a few issues with stopping tasks, and this will correct that.

Import the config.gateway.json file into the Controller

SSH into the Controller, and import the config.gateway.json file into the /sites/default/ directory.

  • <unifi_base>/data/sites/.

NOTE: There are various ways to import a file.

Consider scp or sftp:

sftp://root@servername/directory
  • The config.gateway.json file must have unifi:unifi as the owner and group permissions.
    chown unifi:unifi config.gateway.json

igmpcheck.sh

Once the file is in the Unifi Controllers directory after a reboot/ provision of the USG you may notice the IGMP-Proxy begins working. For unknown reasons with Unifi the IGMP-Proxy will suddenly stop running, the igmpcheck.sh script will check to confirm if it is running or not and start the IGMP-Proxy if required.

igmpcheck.sh
#!/bin/bash
pidof igmpproxy >/dev/null
if [[ $? -ne 0 ]] ; then
    echo "restarting igmp-proxy"
    /bin/vbash -ic 'restart igmp-proxy'
fi

NOTE: Once the igmpcheck.sh script is ready it needs to be imported into the USG (not the Unifi Controller) using SSH.

  • Import the file into the /config/ directory/

Reboot the network

NOTE: Only reboot the network, and not the Unifi Controller.


Test the Sonos

Test the Sonos App on the main LAN.

NOTE: You should see all the functionality of the Sonos app is working.


References

ubiquiti/igmp_proxy/sonos.1664986990.txt.gz · Last modified: 2022/10/05 16:23 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki