For Sonos on a dedicated network (VLAN), but to be able to control it from their main network.
Sonos relies heavily on IGMP.
Prerequisites:
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.
{ "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.
SSH into the Controller, and import the config.gateway.json file into the /usr/lib/unifi/data/sites/default/ directory.
NOTE: There are various ways to import a file.
Consider scp or sftp:
sftp://root@servername/directory
chown unifi:unifi config.gateway.json
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.
#!/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.
NOTE: Only reboot the network, and not the Unifi Controller.
Test the Sonos App on the main LAN.
NOTE: You should see all the functionality of the Sonos app is working.
If issues are seen, you may need to set the “Upstream” subnet as your WAN and the “Downstream” as your LAN; by changing the interface in the configuration.
ps -ax
NOTE: This will list the running services.