/routing pim interface
add interface=[PLAYER_VLAN]
add interface=[CONTROLLER_VLAN]
/ip firewall filter
add chain=forward comment="Forward Sonos multicast traffic" dst-address=239.255.255.250
add chain=forward comment="Forward Sonos remote control events to players" in-interface=[CONTROLLER_VLAN] out-interface=[PLAYER_VLAN] dst-port=1400,4444 protocol=tcp
add chain=forward comment="Forward Sonos remote control events from players" in-interface=[PLAYER_VLAN] out-interface=[CONTROLLER_VLAN] dst-port=3400,3401,3500 protocol=tcp
add chain=forward comment="Forward Sonos UPnP device discovery events from players" in-interface=[PLAYER_VLAN] out-interface=[CONTROLLER_VLAN] 10.28.40.0/24 dst-port=1900,1901 protocol=udp
:global ifControl “ether1-master-local”
:global ifSonos “ether23-slave-local”
:global netControl “10.0.1.0/24”
:global plcBefore “6”
/routing pim interface
add interface=$ifSonos
add interface=$ifControl
/ip firewall filter
add chain=forward comment="Forward Sonos multicast traffic" dst-address=239.255.255.250 place-before=$plcBefore
add chain=forward comment="Forward Sonos remote control events to players" in-interface=$ifControl out-interface=$ifSonos dst-port=1400,4444 protocol=tcp place-before=$plcBefore
add chain=forward comment="Forward Sonos remote control events from players" in-interface=$ifSonos out-interface=$ifControl dst-port=3400,3401,3500 protocol=tcp place-before=$plcBefore
add chain=forward comment="Forward Sonos UPnP device discovery events from players" in-interface=$ifSonos out-interface=$ifControl dst-address=$netControl dst-port=1900,1901 protocol=udp place-before=$plcBefore
/system script environment
remove [find name="ifControl"]
remove [find name="ifSonos"]
remove [find name="netControl"]
remove [find name="plcBefore"]
:global ifControl "ether1-master-local" <- This is the name of the VLAN you will have the controller on (av or iDevice)
:global ifSonos "ether23-slave-local" <- This is the name of the VLAN the Sonos players will sit on
:global netControl "10.0.1.0/24" <- this is the network that your controlling device VLAN is on
Yes. Unless you implement either of the two solutions above (properly configured igmp-proxy or PIM) thus allowing you to connect controllers PCs, iPhone app, etc... with Sonos equipment Connects, Amps, Play One, etc... across VLANs.Are you saying that the smart phone and the SONOS will have to be on the same VLAN in the house??
@florid Could you elaborate on this setup a little bit more and how you got it working and the firewall rules you used?I recently implemented the same for Sonos by using igmp-proxy not PIM.
Just need to add the interfaces into igmp-proxy and set which one is upstream, then apply the firewall rules for allowing UPnP traffic. That's it.
According to Mikrotik Wiki igmp proxy is slightly lightweight than PIM, that's why I prefer this.
So - I needed to do this and was able to get it to work. I made a little script. You can edit the first 4 lines and copy/paste the whole thing and the rest is taken care of.
First: You need to download the additional packages for your version, then install the "multicast..." package and reboot. This will give you the /routing/pim option.
Second: edit the first 4 lines of the script (code below) to be correct for your situation.Third: Open a terminal and ssh into the router. Copy and paste the full set of code below and hit enter.
- :global ifControl "ether1-master-local" <- This is the name of the VLAN you will have the controller on (av or iDevice)
:global ifSonos "ether23-slave-local" <- This is the name of the VLAN the Sonos players will sit on
:global netControl "10.0.1.0/24" <- this is the network that your controlling device VLAN is on
:global plcBefore "6" <- Where you want the scripts to start adding to in your firewall.
Fourth: You may need to restart the Sonos app or device to get it to fully register and be recognized by the player/router but it will work. Kick on some music and enjoy.
Code: Select all:global ifControl “ether1-master-local” :global ifSonos “ether23-slave-local” :global netControl “10.0.1.0/24” :global plcBefore “6” /routing pim interface add interface=$ifSonos add interface=$ifControl /ip firewall filter add chain=forward comment="Forward Sonos multicast traffic" dst-address=239.255.255.250 place-before=$plcBefore add chain=forward comment="Forward Sonos remote control events to players" in-interface=$ifControl out-interface=$ifSonos dst-port=1400,4444 protocol=tcp place-before=$plcBefore add chain=forward comment="Forward Sonos remote control events from players" in-interface=$ifSonos out-interface=$ifControl dst-port=3400,3401,3500 protocol=tcp place-before=$plcBefore add chain=forward comment="Forward Sonos UPnP device discovery events from players" in-interface=$ifSonos out-interface=$ifControl dst-address=$netControl dst-port=1900,1901 protocol=udp place-before=$plcBefore /system script environment remove [find name="ifControl"] remove [find name="ifSonos"] remove [find name="netControl"] remove [find name="plcBefore"]
You added both vlan interfaces to PIM module? I would double check the firewall rules and make sure they are exactly like if the script did it. I did it manually without script too and I am pretty sure a software update worked in the past however I have not tried an update recently.Hi,
I have Sonos players in VLAN99, PIM is active and FW rules are also implemented. It works, but not very well. A new controller can only be added to the system, if i put it temporarily in VLN99 . Same with SW-Updates. I cannot start SW-Updates from the "Controller-VLAN10, only if the controller is in the player VLAN.
I have configured manually, not via script. Maybe I missed something, Can someone please confirm, that SW Updates work fine from Controller VLAN?
Thanks,
Spartacus
Could be.Maybe something wrong with Multicast-Settings on the Switch.
/interface vlan
add comment=Office interface=br_vlan name=vlan10 vlan-id=10
add comment=Sonos interface=br_vlan name=vlan30 vlan-id=30
/interface list
add name="Sonos Control"
/interface list member
add comment=SONOS interface=vlan10 list="Sonos Control"
/interface bridge vlan
add bridge=br_vlan comment=Office tagged=sfp1,br_vlan,vlan10 untagged=ether3 vlan-ids=10
add bridge=br_vlan comment=Sonos tagged=sfp1,br_vlan,vlan30,ether8 untagged=ether2 vlan-ids=30
/ip firewall address-list
add address=172.16.10.0/24 list=SonosControl
/ip firewall filter
add action=accept chain=forward comment=\
"SONOS. Forward UPnP Device Discovery events from Players" \
dst-address-list=SonosControl dst-port=1900,1901 in-interface=vlan30 \
protocol=udp
add action=accept chain=forward comment=\
"SONOS: Forward Contoller events from Players" dst-port=3400,3401,3500,4444 in-interface=vlan30 out-interface-list=\
"Sonos Control" protocol=tcp
add action=accept chain=forward comment=\
"SONOS: forward Controller events to Players" dst-port=1400,4444 \
in-interface-list="Sonos Control" out-interface=vlan30 protocol=tcp
add action=accept chain=forward comment="SONOS: forward Multicast traffic" \
dst-address=239.255.255.250 log-prefix=MultiCast
/routing pim interface
add comment="Sonos player" interface=vlan30
add interface=vlan10
add comment="Sonos Clients" interface=vlan50
/routing pim rp
add address=172.16.30.1
add chain=forward comment="Forward Sonos multicast traffic" dst-address=239.255.255.250 place-before=$plcBefore
add chain=forward comment="Forward Sonos UPnP device discovery events from players" in-interface=$ifSonos out-interface=$ifControl dst-address=$netControl dst-port=1900,1901 protocol=udp
I don't know if this matters, but your routing PIM section in the previous post... I don't have anything in my "RP" section of that, and it works fine. If you remove the RP entry completly does it work? I have the two vlans (sonos and control) added to interface tab in PIM and that's it.Hi,
it´s me again.
I see that two FW-rules are not working because package counter is 0. But I do not know why!
in-interface is vlan30 which is configured on the bridge with vlan-filtering, also vlan10 which configured in the same way.Code: Select alladd chain=forward comment="Forward Sonos multicast traffic" dst-address=239.255.255.250 place-before=$plcBefore add chain=forward comment="Forward Sonos UPnP device discovery events from players" in-interface=$ifSonos out-interface=$ifControl dst-address=$netControl dst-port=1900,1901 protocol=udp
I gues something with multicast routing is not working. Can someone help here?
Christian
My Windows and Android controllers are on same vlan as sonos players but my Mac controller is on a different vlan and that can connect to players, with the setup I mentioned in my above posts that works, confirming that the original instructions posted on this thread worked with just modifications for my vlan names and numbers being different.Hi all,
thank you for your reply, but it doesn´t change anything if I remove the RP.
What I noticed is, that the SONOS players use different UDP-Ports for communication if they try to connect to a controller. I saw a lot of upd -FW-drops in a range between 30000-60000.
If I open this range, connection to a controller is possibe. This is very interesting, because I do not find any documents about this "higher" udp-Port communication and I am not sure why this only happens to my system and others can connect to controllers with the standard port configuration.
Can someone please confirm, that he can connect a new Sonos Windows or Android Controller to the SONOS-Net Environment, without additional configuration? I can only do that, if I allow all udp-Ports in my FW rules.
Christiam
My Mac is already in a different subnet than the players, that is what works already. By Sonos-NET do you mean the WiFi network that the players create that you can connect to? Because that is what you are doing then maybe that is the problem. My devices whether they are on same vlan/subnet as players or not, are using regular WiFi connections or Wired Ethernet. No controller device is connected to the Sonos-NET WiFi network that the players create themselves.Hi,
only one last question!
If you reset the controller on your MAC (disconnect from SONOS-Net), and if you then try to register the controller again to your existing SONOS-System. Does this work with the setup above, if your MAC is in a different Subnet than the Players?
If you can test this,, it would be great!
Thanks,
Christian
Ahh okay, I don't want to mess with actually trying it on the Mac since it's working BUT I installed a windows 10 VM on my Mac and tried to connect a new install of sonos controller for windows and it would not find the players, just like you say. I am fairly certain that when I did the Mac months ago it did work, so maybe a recent update changed something where it can't make the initial connection unless on same vlan as players. I am guessing also if it work when you open that large range of UDP ports, that maybe the software is using a randomly open port for connections so there is nothing you can open to predict that except a large range.Hi,
we talk at cross purposes
My players are all connected to the LAN by Ethernet. The players are in vlan30, the controller in vlan10
FW between vlan10 and vlan30 is setup as above! Everything works, once controller is registered.
BUT:
If you start a fresh installed controller software on a client, the Sonos software asks you "do you want to connet to a new Sonos Sytem, or do you want to connect to an existing Sonos System". And if you choose "connect to an existings Sonos System" the SW connects to your players and you can see the players the rooms etc.
In my Configuration:
This works only, if controller and player are in the same subnet, it works not, if controller and player are in different subnets with the FW-rules above.. I only wanted to know, if someone can add fresh installed controllers to the existing Sonos System, if players and controllers are in different Subnets.
You can test this, if you select "reset controller" in the Sonos-SW under "help.". (german version: Hilfe->Controller zurücksetzen) Christian
I tried an update and it didn't work, although I tried update from controller on same vlan as players and it still seemed to fail so not sure what is going on.Hi ilovepancakes,
thank you so much for this test! I thought I was going crazy! None undestood my issues, but now, I have the certainty that only "operation-mode" will work with the FW-rules above!
BTW:
I also noticed, that you are not able to make Sonos Updates from a controller in a diffrent Subnet! It would be great, if you can test this also (next time when Sonos provides an update) from a controller outside the player network!
Seems to be that the FW-rule-set is not complete!
Regards,
Christian
lol, yeah well I have been using this method to control Sonos from my main PC which is on a management VLAN. Guess Sonos wants to start enforcing the app actually being on same WiFi SSID or same ethernet subnet even if the players are found and displayed. Would be great if there was some way to trick the app into thinking it's still on the same network.Not the greatest news - my solution - put a sticky on the SONOS that says, "Use SSID XXXX from smartphone".
I can second this symptom and solution. Found out by watching communication on wireshark on a controller on same subnet as the Sonos Playback devices.I was able to get control working again using latest sonos software controller and firmware versions by opening up UDP ports 32000-65535 from sonos players to my controller PC.
So a total solution for me (Sonos S1 - the old version) is: