How to configure your UniFi network for Sonos
Goal
Using Sonos devices in a UniFi network has been a common source of network issues which can be hard to detect. Over the years, there have been many threads in the UniFi Community, Sonos Community, Reddit, and other places. This document aims to provide a canonical, community-driven, and up-to-date reference for the most common use cases.
Symptoms
If you have Sonos devices in your UniFi network, you may experience some of the following symptoms which may appear unrelated but are a consequence of broadcast storms:
- .local name resolution not working
- Sonos speakers disappear from the network
- AirPrint-capable printers are not available
- HomeKit devices not found
- Time Machine backups fail
- Mobile applications fails to discover devices on the local network (e.g. the IKEA Smart Home app)
Root Cause
Sonos OS (even the current S2) uses older / pre-standard STP path costs which makes it incompatible with the newer RSTP protocol which was introduced in 2001 and is the default for UniFi switches. STP can take up to a minute to converge, while RSTP typically converges under ten seconds in normal operation.
This becomes a problem when you operate both wired and wireless Sonos device in your network (even without SonosNet) and can result in a wireless path being preferred over wired, ports being blocked, or broadcast storms.
Recommended Settings
Use the following settings (as of Sonos OS S2 13.2, UniFi Network Application 7.4.156):
- Multicast DNS: on (likely required only if Sonos devices are segregated into a separate VLAN)
- Settings -> Networks ->
$YOUR_NETWORK
- Settings -> Networks ->
- IGMP Snooping: on (helps reduce the multicast traffic from Sonos devices)
- Settings -> Networks ->
$YOUR_NETWORK
- Settings -> Networks ->
- Multicast Enhancement (IGMPv3): on
- Settings -> Wireless Networks ->
$YOUR_NETWORK
- Settings -> Wireless Networks ->
- Multicast and Broadcast Control: off
- Devices ->
$DEVICE
-> Ports ->$AFFECTED_PORT
- Devices ->
- Block LAN to WLAN multicast and broadcast data (Classic UI): off
- Settings -> Wireless Networks ->
$YOUR_NETWORK
- Settings -> Wireless Networks ->
- Spanning Tree: RSTP
- Networks -> Global Switch Settings
- UniFi Devices ->
$DEVICE
-> Settings -> Advanced -> Spanning Tree
- Port settings on the LAN ports that connect to Sonos gear: disable Enable Spanning Tree Protocol
- UniFi Devices ->
$DEVICE
-> Ports ->$AFFECTED_PORT
- UniFi Devices ->
Alternatively, you can change all your switches to use STP instead of RSTP, but this may make acquiring an IP over DHCP slow. If you do that, assign priority values manually: use priority 4096 for your main switch (going to your router/firewall) and add 4096 for each hop from there (e.g. 8192 for second-level switches, 12288 for third-layer switches). However, the UDM, UDMP, and UDM-SE do not support STP. It can be temporarily enabled using brctl setbridgeprio br0 4096; brctl stp br0 on
.
References
Official Documentation
Community Threads
- Issues with mDNS / multicast / AirPrint / HomeKit / Sonos
- Will Sonos S2 support RSTP or newer STP path costs?
- Sonos and Unifi gear / VLANs - RSTP update
- UniFi, STP and Sonos
- Google Home speaker groups/Homekit/Sonos/Airprint/IoT/Multicast/mDNS issues?
- HomeKit Multicast issues across a wireless mesh link