How can I get this UDP relay package for casting across VLANs?
-
@tman222 Thanks for following up - and confirming that your Android GH app is working okay. Mine is still not working well, though I've noticed that Home isn't working great in general atm (e.g. I ask it to play streams and they time out more often than not). I have one Google Home Hub in the IOT VLAN with my Chromecast audios, Google Home speakers, etc. and I wonder if something about the multicast address registration is not working properly. I've rebooted the firewall and the Google Home Hub but still no joy here. I'm pretty certain here weren't any other changes to my network. I have a couple of other things I probably have to prioritize above further troubleshooting, but worst case I'm planning on some troubleshooting no later than this weekend.
-
@burntoc said in How can I get this UDP relay package for casting across VLANs?:
@tman222 Thanks for following up - and confirming that your Android GH app is working okay. Mine is still not working well, though I've noticed that Home isn't working great in general atm (e.g. I ask it to play streams and they time out more often than not). I have one Google Home Hub in the IOT VLAN with my Chromecast audios, Google Home speakers, etc. and I wonder if something about the multicast address registration is not working properly. I've rebooted the firewall and the Google Home Hub but still no joy here. I'm pretty certain here weren't any other changes to my network. I have a couple of other things I probably have to prioritize above further troubleshooting, but worst case I'm planning on some troubleshooting no later than this weekend.
@burntoc - did you change any settings on your wireless access points or network switches?
-
@tman222 That's what I'm going to check, but I'm 99% sure I did not change any of that. I have 2 APs that trunk to the main switch, and I didn't mess with those APs, the trunks to the switch, or the trunk from the switch to the fireawall. No other mDNS or other changes, either.
-
Just wanted to follow up on this thread quick and mention that this is still tool is working great for me without any issues (despite several reboots of the firewall since the initial install and configuration). A great alternative to Avahi if one is looking to get Google Home speaker groups to work. Even though I have not been able to try this out yet, it may also be a suitable alternative for pimd to get Sonos speakers to work.
-
UPDATE 5/25/2023:
As of pfSense Plus 23.05,
udpbroadcastrelay
is now a formal pfSense package that can be added via the Package Manager.=====================
Just thought I would provide a quick set of instructions to get this package up and going (questions were asked in another thread).
README FIRST:
- Instructions on how to configure the package can be found on the creator's page on GitHub:
https://github.com/marjohn56/udpbroadcastrelay
- Before proceeding always make a backup of your firewall configuration first in case a mistake/misconfiguration renders your system inoperable.
INSTRUCTIONS - Please Read Updates Below As Well:
- Compile the updbroadcastrelay code from GitHub (see @stephenw10's post above for reference: https://forum.netgate.com/topic/155698/how-can-i-get-this-udp-relay-package-for-casting-across-vlans/9) on a FreeBSD system or virtual machine (For pfSense 2.4.5p1 this should be FreeBSD 11.3). If you are not able to compile the code on your own, you can also download the attached archive file which contains a precompiled udpbroadcastrelay binary. Please note that this binary has been compiled under FreeBSD 11.3 and thus only tested to work with the current version of pfSense (at the time of this writing this is 2.4.5-p1).
udpbroadcastrelay_pfSense245p1.zip
UPDATE 2/18/2021:
With pfSense 2.5.0 now being available, @sfxdude has compiled the udpbroadcastrelay code to binary under FreeBSD 12.2 for pfSense 2.5.0. Please see this post:
UPDATE 3/14/2021:
It looks like this package has now been included upstream in FreeBSD, so no longer a need to compile on your own from source:https://www.freshports.org/net/udpbroadcastrelay/
https://forum.netgate.com/topic/155698/how-can-i-get-this-udp-relay-package-for-casting-across-vlans/66-
Next, drop the compiled udpbroadcastrelay binary file into the /root/udpbroadcastrelay directory on your firewall.
-
Install the ShellCmd package on pfSense.
-
Configure the updbroadcastrelay based on your use case and configure the ShellCmd package to start it automatically on startup. Please see:
https://github.com/marjohn56/udpbroadcastrelay#usage
Below are two example commands to illustrate using the package to enable mDNS relaying between two network interfaces, igb0 and igb1:
/usr/bin/nohup /root/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
If using two VLAN's, e.g. 10 and 20:
/usr/bin/nohup /root/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 5353 --dev igb0.10 --dev igb1.20 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
Additional details are also available further up on this thread.
-
Although I have not tried this out, I assume it would be ok to run multiple instances of the udpbroadcastrelay (with different
--id
defined) in case you want to enable mDNS and SSDP at the same time, for example. -
This only sets up the udp relaying between subnets. The necessary firewall rules are still required for devices on different subnets to actually talk to each other (once they have been discovered).
======================
I hope these instructions are useful for those looking to try this out. Please note that I'm not the creator and maintainer of this code base so will be limited with the amount of help I can provide.
-
@tman222 x-posting my reply from the other thread with some observations from my end.
“@tman222 thank you.
I ended up spinning a VM on a old Windows laptop and was able to get the binary working. It works like a charm! Great thing is that it doesn’t need any other packages like Avahi or PIMD ( I never had any 100% success with previously) nor does it require fiddling around with firewall rules. For the first time in 2 years, I have my Sonos working as I intend in my pfSense + Unifi ecosystem.
So far, I have the following tested and working correctly:
Controlling and playing to Sonos speakers across VLANs via the Sonos App v2
Airplay 2 (incl multi-room) works perfectly across VLANS.
LIFX app to manage bulbs across VLAN’s works great
Side effect - HomeKit also works across VLANs although I have only tested with anything else other than the LIFX bulbs. Now that I have my IoT network in working order, I feel like investing in more devices.
I just need to figure out a reliable way to keep the package running if/when pfSense reboots (eg via shellcmd).@tman222 Do you use Cloudflare DNS? Not sure I understand what the hard coded 1.1.1.1 source address in the package does? So far I’m not seeing any conflicts with their DNS, but will keep an eye out if anything breaks.”
Re:#5: Yes, I can confirm multiple instances of the process with a unique ID works. That’s how I have it running,
#6: Agree - this will be unique to everyone’s case based on their VLAN configuration, but in my instance, I only have one rule alllowing all traffic from My LAN to any. Does this open up any security risks?
-
From the man page:
A special source ip of -s 1.1.1.1 can be used to set the source ip to the address of the outgoing interface and the source UDP port to the same as the destination port. '-s 1.1.1.2' does the same but leaves the UDP ports unchanged. These values are notably required to cater for the Chromecast system.
Steve
-
@stephenw10 said in How can I get this UDP relay package for casting across VLANs?:
./udpbroadcastrelay
Maybe I missed it, but what is the command to quit/stop/kill it?
-
@Qinn said in How can I get this UDP relay package for casting across VLANs?:
@stephenw10 said in How can I get this UDP relay package for casting across VLANs?:
./udpbroadcastrelay
Maybe I missed it, but what is the command to quit/stop/kill it?
Hi @Qinn - I've had no trouble terminating / stopping the udpbroadcastrelay process just using the
kill
command, i.e. if process id (PID) is12345
, then I would issue the following from the shell:kill 12345
https://www.freebsd.org/cgi/man.cgi?query=kill&apropos=0&sektion=1&manpath=FreeBSD+11.3-RELEASE
Hope this helps.
-
@tman222 said in How can I get this UDP relay package for casting across VLANs?:
@Qinn said in How can I get this UDP relay package for casting across VLANs?:
@stephenw10 said in How can I get this UDP relay package for casting across VLANs?:
./udpbroadcastrelay
Maybe I missed it, but what is the command to quit/stop/kill it?
Hi @Qinn - I've had no trouble terminating / stopping the udpbroadcastrelay process just using the
kill
command, i.e. if process id (PID) is12345
, then I would issue the following from the shell:kill 12345
https://www.freebsd.org/cgi/man.cgi?query=kill&apropos=0&sektion=1&manpath=FreeBSD+11.3-RELEASE
Hope this helps.
Thanks for your quick reply! I know of the kill command, just don't understand that the developer did not add a quit/stop option for it's users for this service. So I hoped I missed it in the syntax, but apparently it's not there.
It's seems to be an OPNsense package/Plugin with a GUI which has the start and stop https://forum.opnsense.org/index.php?topic=15910.0
For anyone who needs it:
How to kill the udpbroadcastrelay service
PS
this will give you the process ID (PID)
PID TT STAT TIME COMMAND 38231 0- S 0:00.36 ./udpbroadcastrelay --id 2 --port 1900 --dev
then use the kill command
kill 38231
-
@stephenw10 said in How can I get this UDP relay package for casting across VLANs?:
From the man page:
A special source ip of -s 1.1.1.1 can be used to set the source ip to the address of the outgoing interface and the source UDP port to the same as the destination port. '-s 1.1.1.2' does the same but leaves the UDP ports unchanged. These values are notably required to cater for the Chromecast system.
Steve
Could udpbroadcastrelay be implemented as a GUI, must say it's rather a simple and elegant tool compared to PIMD
-
The feature request is open, add your comments there:
https://redmine.pfsense.org/issues/10818It's certainly relatively simple. There is a fine line between elegant and crude.
Hard to argue with what works though.
Steve
-
@stephenw10 Nice
-
@tman222 said in How can I get this UDP relay package for casting across VLANs?:
/usr/bin/nohup /root/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
I know what the nohup is for, just don't understand why the nohup in needed as nohup implies that the executed command can/may survive past logout. I tested
/root/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
and updbroadcastrelay stayed up after I logged out as root.
Or has it something to with Shellcmd or did I miss something else ?
-
I would normally use it with a shellcmd. I have seen commands run there fail at the end of boot otherwise.
Though since that's expected to run as a service it may not be required.
Steve
-
Aha so it's shellcmd related
-
So in my journey to make sonos work from across Vlans i came to this thread .
I have made some progress :
i created an Ubuntu VM on my server and gave it 2 interfaces one with a trusted network and the other one with the Vlan network.
I think i compiled the program correctly here is the command i ran :
sudo ./udpbroadcastrelay --id 1 --port 5353 --dev enp1s0 --dev enp3s0 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
But it threw an error.
bind: Address already in use
I have no experience at all when it comes to linux.
I hope someone can guide me .
-
@shremi said in How can I get this UDP relay package for casting across VLANs?:
So in my journey to make sonos work from across Vlans i came to this thread .
I have made some progress :
i created an Ubuntu VM on my server and gave it 2 interfaces one with a trusted network and the other one with the Vlan network.
I think i compiled the program correctly here is the command i ran :
sudo ./udpbroadcastrelay --id 1 --port 5353 --dev enp1s0 --dev enp3s0 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
But it threw an error.
bind: Address already in use
I have no experience at all when it comes to linux.
I hope someone can guide me .
Hi @shremi - have you checked to see whether no other program / service in Ubuntu might already be using the multicast address? Beyond that though, is there any particular reason you are trying to use this tool on Linux vs. directly on pfSense? Hope this helps.
-
Thanks @tman222 i was just trying to see if that works and then move it to the pfsense machine.
I made it work it was the avahi daemon runing on the linux VM .... but as soon as i killed that service and opened 5353 for mdns everything on the network went bezerk ...
I mostly run home assistant to get everything centralized and it threw a lot of errors stating that there was another instance of home assistant running with the same name ..... so back to square one i can either create another VM on the server with a freebsd OS or move it directly to the firewall itself.
What made me hesitant to install it on the firewall is :
- that i really don't know how to access the /root/ folder or how can i copy the file to it.
- and how do i make the package to autostart on boot-up
- i also don't know if should delete the avahi package
I have a couple of free days since a relative tested positive for Covid and we are just being careful our test came back negative .
-
@shremi said in How can I get this UDP relay package for casting across VLANs?:
-
- that i really don't know how to access the /root/ folder or how can i*
@shremi I guess you are a Windows man ;) Install WinSCP and use de scp protocol on port 22 and login to pfSense
make a directory in /root named udpbroadcastrelay
copy the udpbroadcastrelay file to this directory
Now you have to make udpbroadcastrelay executable
use properties on the file in WinSCP to change it to 0755 or use telnet to do this manually withchmod 755 udpbroadcastrelay
You picked the wrong startup command for Sonos devices you do not need --multicast 224.0.0.251 but --multicast 239.255.255.250 see below
-
- i and how do i make the package to autostart on boot*
Install the Shellcmd package from the package manager in pfSense
use this command in Shellcmd with of course your vlans/usr/bin/nohup /root/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 1900 --dev igb1.10 --dev igb1.20 --multicast 239.255.255.250 -f > /dev/null
-
- i also don't know if should delete the avahi package*
You can leave it installed
-