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 .
-
@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
-
-
@Qinn said in How can I get this UDP relay package for casting across 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
Thanks a lot fo this @QINN i really appreciate it. Yeah i am lost when it comes to linux-freebsd :(
So here is where i am at :
I followed the instructions correctly as you stated. how can i verify that it is working. ???
Im guessing i need to open some sort of connection to a command line to input the cmd commands in the firewall?
Heres what i did :
I went to services and then to shellcmd and created this command.
/usr/bin/nohup /root/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 1900 --dev igb0 --dev igb0.40 --multicast 239.255.255.250 -f > /dev/null
I am using LAN and VLAN 40 on the same igb0 port i think that should work right?
i created an alias for the sonos stuff and then created a rule on the IoT vlan to for the sonos alias to talk to the private network.
But still no connection via the app.
I am sure i am missing something.
-
@shremi 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?:
I am sure i am missing something.
Yeah quoting myself hahahaha !!
Thanks a lot i think i just needed to reboot the pfsense machine i can discover and talk to sonos devices from my private network.
I am going to tight down the aliases instead of giving the sonos players full access to the main trusted network. i will give it to the phones and home assistant VM.
The only thing that it seems that stopped working is the UPnP Service for pfsense i used to have it for the consoles but i dont think that they are in use .
Next up i would like to use this for mDNS and get rid of avahi since i read that using this option has a little bit of more advantages over the avahi package.
-
@shremi You can see it running from the command line, best is to login using putty with SSH or when you have installed WinSCP press Control T and a terminal will open. Here you enter the ps command (processes status)
ps
You will get something like
/root/udpbroadcastrelay$ ps PID TT STAT TIME COMMAND 28327 u0- SN 14:19.50 /bin/sh /var/db/rrd/updaterrd.sh 73155 u0 Is 0:00.02 login [pam] (login) 73672 u0 I 0:00.02 -sh (sh) 90155 u0 I+ 0:00.01 /bin/sh /etc/rc.initial 71121 v0 Is 0:00.02 login [pam] (login) 73887 v0 I 0:00.02 -sh (sh) 75937 v0 I+ 0:00.01 /bin/sh /etc/rc.initial 71448 v1 Is+ 0:00.01 /usr/libexec/getty Pc ttyv1 71544 v2 Is+ 0:00.01 /usr/libexec/getty Pc ttyv2 71638 v3 Is+ 0:00.01 /usr/libexec/getty Pc ttyv3 71836 v4 Is+ 0:00.01 /usr/libexec/getty Pc ttyv4 72169 v5 Is+ 0:00.01 /usr/libexec/getty Pc ttyv5 72465 v6 Is+ 0:00.01 /usr/libexec/getty Pc ttyv6 72832 v7 Is+ 0:00.01 /usr/libexec/getty Pc ttyv7 50749 0 S 0:00.00 ./udpbroadcastrelay --id 1 --port 1900 --dev igb1.1005 82781 0 Is 0:00.01 -sh (sh) 83059 0 I 0:00.01 /bin/sh /etc/rc.initial 85940 0 S+ 0:00.07 /bin/tcsh
Btw Using the commandline I would always advise to install putty https://www.putty.org/
-
first enable SSH in pfSense -> System /Advanced/Admin Access
🔒 Log in to view -
Then install putty https://www.putty.org/ and enable SSH in pfSense and login with SSH
-
- 3 months later
-
Thanks, this help me to get working control of my devices between VLANs.
- 8 days later
-
@burntoc Thanks for all the hard work on this. I can't wait for this to get a proper pfsense package, and updates when pfsense 2.5 gets released.
This software got the following apps to work across segmented networks:
- Denon HEOS
- Onkyo Remote3
- FiOS TV Remote (plus some FW rules)
- 9 days later
-
I have found this tool really handy for me so I want to help to make it happen, unfortunately I don't have the programming skills to do any of the behind the scenes nuts and bolts stuff, but what I can do is front-end stuff and help develop the logic so that a programmer can simply follow that.
To show my genuine interest I have made a package panel and am wondering if it is worth perusing any further, i.e. developing the underlying logic etc? Here is what it looks like:
- 15 days later
-
In case this helps anyone, I built this on freeBSD 12.2 for pfsense 2.5.0:
udpbroadcastrelay-pfsense2.5.0.zip -
@sfxdude Thank you! I was just sitting down to spin up a VM to build this for 12.2. You saved me the time.
-
@sfxdude said in How can I get this UDP relay package for casting across VLANs?:
In case this helps anyone, I built this on freeBSD 12.2 for pfsense 2.5.0:
udpbroadcastrelay-pfsense2.5.0.zipThanks @sfxdude - I will go ahead and update my post above as well to point to yours with the new 2.5 file.
I upgraded to 2.5 yesterday and it looks like the udpbroadcastrelay binary I compiled under FreeBSD 11.3 still works fine under FreeBSD 12.2. Is there a need to upgrade to the latest binary if the old one works fine?
Thanks in advance.
-
@tman222 I'd say if it works it's probably fine, but no harm in rebuilding for the new one.
- 22 days later
-
Anyone has the binary avaliable for the sg-1100?
-
Obviously it would need to be compiled for aarch64. It might be simple enough a compile against FreeBSD 12.2 will work. You would need to be setup for cross-compiling or have am aarch64 build box.
Adding your comments to the feature request night be best.Steve
-
@tman222 said in How can I get this UDP relay package for casting across VLANs?:
udpbroadcastrelay
I think it is here https://freebsd.pkgs.org/12/freebsd-aarch64/udpbroadcastrelay-0.3.b.txz.html
I can't test it for aarch64, as I don't own one, but downloaded the am64 version copied it to pfSense 2.5.0 and did a
chmod 755 udpbroadcastrelay
Then excuted it and it performed nicely.
-
stephenw10 Netgate Administratorlast edited by stephenw10 Mar 14, 2021, 11:45 AM Mar 14, 2021, 11:42 AM
Oh that's interesting, I didn't realise it had been included upstream. Makes things a lot easier.
Though I had to upload it rather than fetch it directly:
[21.02-RELEASE][admin@2100-2.stevew.lan]/tmp: pkg add udpbroadcastrelay-0.3.b.txz Installing udpbroadcastrelay-0.3.b... Extracting udpbroadcastrelay-0.3.b: 100% [21.02-RELEASE][admin@2100-2.stevew.lan]/tmp: rehash [21.02-RELEASE][admin@2100-2.stevew.lan]/tmp: udpbroadcastrelay usage: udpbroadcastrelay [--id ID] [--port udp-port] [--dev dev1] [--dev dev2] [--dev devX] [-s IP] [--multicast ip1] [--multicast ipX] [-t|--ttl-id] [-d] [-f] [-h|--help]
Edit: Looks like it was only added last week.
Steve
-
Cool, this is great news! I assume this link is for the amd64 version of the package?
https://pkgs.org/download/udpbroadcastrelay
https://freebsd.pkgs.org/12/freebsd-amd64/udpbroadcastrelay-0.3.b.txz.htmlI actually just recently recompiled the udpbroadcastrelay source for pfSense 2.5.0 (FreeBSD 12.2 Stable) but will keep this link in mind for future versions. I'll also update my initial post in the thread above.
-
@stephenw10 - when installing the
udpbroadcastrelay
as a FreeBSD package, where on the file system is the binary located (will be needed for ShellCmd)? Thanks in advance. -
@tman222 said in How can I get this UDP relay package for casting across VLANs?:
@stephenw10 - when installing the
udpbroadcastrelay
as a FreeBSD package, where on the file system is the binary located (will be needed for ShellCmd)? Thanks in advance.Usually binary executables from packages go in
/usr/local/bin
and configuration files in/usr/local/etc
. Any shell script provided with the package typically winds up in/usr/local/etc/rc.d
. But these are not hard and fast rules - a package creator might deviate from the standard practice. -
-
btw if you don't have the repository, then do a
pkg add https://pkg.freebsd.org/FreeBSD:12:amd64/quarterly/All/udpbroadcastrelay-0.3.b.txz
for an AMD64 and then a
rehash
and a
pkg info udpbroadcastrelay
shows it is nicely installed
[2.5.0-RELEASE][root@pfSense.localdomain]/: pkg info udpbroadcastrelay udpbroadcastrelay-0.3.b Name : udpbroadcastrelay Version : 0.3.b Installed on : Wed Mar 17 11:54:50 2021 CET Origin : net/udpbroadcastrelay Architecture : FreeBSD:12:amd64 Prefix : /usr/local Categories : net Licenses : GPLv2 Maintainer : m.muenz@gmail.com WWW : https://github.com/marjohn56/udpbroadcastrelay Comment : UDP multicast/unicast relayer Annotations : FreeBSD_version: 1202000 Flat size : 39.2KiB Description : udpbroadcastrelay is a UDP multicast relayer. Its intended use is to rebroadbcast udp packets on a specific port across interfaces, be those interfaces physical or VLAN. It is used where devices such as Sonos or Sky are spread accross different subnets and are not able to detect the servers or devices. WWW: https://github.com/marjohn56/udpbroadcastrelay
-
Hi,
can someone give me a hint how the command looks like for Shellcmd/command prompt (pfsense 2.5.0 / APU2C4)?
With "find / -name 'udpbroadcastrelay'" I could find udpbroadcastrelay in "/usr/local/sbin/".
With Putty and "/usr/local/sbin/udpbroadcastrelay --id 1 --port 5353 --dev igb1 --dev igb1.12 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null" everything works perfectly but not in pfSene (command prompt) itself. -
@itar said in How can I get this UDP relay package for casting across VLANs?:
Hi,
can someone give me a hint how the command looks like for Shellcmd/command prompt (pfsense 2.5.0 / APU2C4)?
With "find / -name 'udpbroadcastrelay'" I could find udpbroadcastrelay in "/usr/local/sbin/".
With Putty and "/usr/local/sbin/udpbroadcastrelay --id 1 --port 5353 --dev igb1 --dev igb1.12 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null" everything works perfectly but not in pfSene (command prompt) itself.Hi @itar - please take a look at my post above, I think you might be missing the
/usr/bin/nohup
command as part of the ShellCmd: -
Hi tman222,
thank you very much!
I read your post, but I thought it would also work with "/usr/local/sbin" instead of "/root/udpbroadcastrelay/". Now I copied "udpbroadcastrelay" to root... and it works like a charm
-
@itar said in How can I get this UDP relay package for casting across VLANs?:
Hi tman222,
thank you very much!
I read your post, but I thought it would also work with "/usr/local/sbin" instead of "/root/udpbroadcastrelay/". Now I copied "udpbroadcastrelay" to root... and it works like a charm
Hi @Itar - I would have expected it to work from
/usr/local/sbin
as well as long as you have the/usr/local/nohup
and call the executable by./udpbroadcastrelay
if needed (note the./
) The instructions above are bit dated back from when we had to compile the code manually to create the binary vs. installing it as a FreeBSD package. -
Hi tman222,
no, I tried /usr/bin/nohup /usr/local/sbin/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null but it didn't work.
-
This post is deleted! -
@itar said in How can I get this UDP relay package for casting across VLANs?:
Hi tman222,
no, I tried /usr/bin/nohup /usr/local/sbin/udpbroadcastrelay/./udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null but it didn't work.
Hmmm - do either of these work?
/usr/bin/nohup /usr/local/sbin/./udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
or
/usr/bin/nohup /usr/local/sbin/udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
-
Ahhhhh,
/usr/bin/nohup /usr/local/sbin/udpbroadcastrelay --id 1 --port 5353 --dev igb0 --dev igb1 --multicast 224.0.0.251 -s 1.1.1.1 -f > /dev/null
is working!
Thanks!
- 10 days later
-
Re: How can I get this UDP relay package for casting across VLANs?
So I just came across this thread after trying for over a day to get Sonos clients on my LAN subnet discovering the Sonos devices on an isolated IOT subnet using the PIMD package as a multicast reflector.
IOS clients that had previously been connected when everything was on the same subnet continue to work once the relevant firewall rules were setup, but new clients (Mac, Win10) can't discover the Sonos device.
I've removed PIMD, rebooted and installed the package as per the instructions above. I'm seeing the following error when trying to run the command (as root) with the debug option:
# udpbroadcastrelay --id 1 --port 1900 --dev igb1 --dev igb2 --multicast 239.255.255.250 -d ID set to 1 Port set to 1900 ID: 1 (DSCP: 1, ToS: 0x04), Port 1900 igb1: 2 / 172.16.10.1 / 172.16.10.255 igb2: 3 / 172.16.20.1 / 172.16.20.255 found 2 interfaces total IP_ADD_MEMBERSHIP: 172.16.10.1 239.255.255.250 IP_ADD_MEMBERSHIP: 172.16.20.1 239.255.255.250 bind: Address already in use rcv bind
Not sure what would already be using 239.255.255.250:1900 or how to go about debugging from here.
Any pointers greatly appreciated
-
did you do a ps to check if it is already running?
-
There are no other instances of udpbroadcastrelay running but pfTop shows an existing state from the pfsense interface on the IOT subnet.
pfTop: Up State 1-1/1 (545), View: default, Order: bytes PR DIR SRC DEST STATE AGE EXP PKTS BYTES udp Out 172.16.20.1:52980 239.255.255.250:1900 SINGLE:NO_TRAFFIC 00:02:52 00:00:09 132 62676
I'll try temporarily powering down all other devices on that subnet and see if that helps
-
The way to check if it running and to stop udpbroadcastrelay is using the ps command and kill the process using it's process number (PID)
[2.5.0-RELEASE][root@pfSense.localdomain]/root: ps PID TT STAT TIME COMMAND 7615 u0- S 41:14.27 /usr/local/sbin/pcscd 60580 u0 Is 0:00.02 login [pam] (login) 60845 u0 I 0:00.01 -sh (sh) 61388 u0 I+ 0:00.01 /bin/sh /etc/rc.initial 2456 v0 I 0:00.02 -sh (sh) 3896 v0 I+ 0:00.01 /bin/sh /etc/rc.initial 99884 v0 Is 0:00.02 login [pam] (login) 188 v1 Is+ 0:00.01 /usr/libexec/getty Pc ttyv1 330 v2 Is+ 0:00.01 /usr/libexec/getty Pc ttyv2 368 v3 Is+ 0:00.01 /usr/libexec/getty Pc ttyv3 579 v4 Is+ 0:00.01 /usr/libexec/getty Pc ttyv4 592 v5 Is+ 0:00.01 /usr/libexec/getty Pc ttyv5 1002 v6 Is+ 0:00.01 /usr/libexec/getty Pc ttyv6 1293 v7 Is+ 0:00.01 /usr/libexec/getty Pc ttyv7 6730 0 S 0:00.00 udpbroadcastrelay --id 1 --port 1900 --dev igb1.1005 --dev igb1.1007 --multicast 239.255.255.250 -f 6919 0 R+ 0:00.01 ps 41171 0 Is 0:00.02 -sh (sh) 41565 0 I 0:00.01 /bin/sh /etc/rc.initial 45295 0 S 0:00.12 /bin/tcsh
/root: kill 6730
[2.5.0-RELEASE][root@pfSense.localdomain]/root: ps PID TT STAT TIME COMMAND 7615 u0- S 41:14.29 /usr/local/sbin/pcscd 60580 u0 Is 0:00.02 login [pam] (login) 60845 u0 I 0:00.01 -sh (sh) 61388 u0 I+ 0:00.01 /bin/sh /etc/rc.initial 2456 v0 I 0:00.02 -sh (sh) 3896 v0 I+ 0:00.01 /bin/sh /etc/rc.initial 99884 v0 Is 0:00.02 login [pam] (login) 188 v1 Is+ 0:00.01 /usr/libexec/getty Pc ttyv1 330 v2 Is+ 0:00.01 /usr/libexec/getty Pc ttyv2 368 v3 Is+ 0:00.01 /usr/libexec/getty Pc ttyv3 579 v4 Is+ 0:00.01 /usr/libexec/getty Pc ttyv4 592 v5 Is+ 0:00.01 /usr/libexec/getty Pc ttyv5 1002 v6 Is+ 0:00.01 /usr/libexec/getty Pc ttyv6 1293 v7 Is+ 0:00.01 /usr/libexec/getty Pc ttyv7 37961 0 R+ 0:00.00 ps 41171 0 Is 0:00.02 -sh (sh) 41565 0 I 0:00.01 /bin/sh /etc/rc.initial 45295 0 S 0:00.13 /bin/tcsh
-
@captaincathode Would be good to disable other related plugins and/or other firewall rules on you IoT subnet like Avahi etc if you ever had them installled.
-
Anyone here using HomeKit across VLAN’s? I have Apple’s Home app successfully work to recognise and control many devices on my IoT VLAN’s.
One minor annoyance I have been having is with a particular smart home device - Meross Garage opener (HomeKit version). Their mobile app works fine over VLAN’s, however via the native Apple Home app(& via Siri) I’m unable to open the garage on the first request (even though the app acknowledges that the request has been successfully completed). The subsequent call / 2nd request always works like a charm and the garage opens up consistently. This means my garage door automations don’t work as expected via the Shortcuts or Home App.
I’m wondering if that’s due to the nature of VLAN hops and how that specific device works across VLAN’s? Or some other issue related to HomeKit or the Home App on iOS itself? FWIW, I have plenty of other IoT devices(eg Light Bulbs, Sonos speakers etc) connected via HomeBridge all of which work fine (mostly :-)) on the first attempt.
- 11 days later
-
Getting back to this after nearly two weeks of being too busy to look at it . . .
I found that UPnP/NAT-PMP was preventing udpbroadcastrelay from starting. I have an XBox One on the same IOT subnet, and pfSense is configured to allow it to use UPnP.
If I stop the UpNP/NAT-PMP daemon (miniupnpd) I can successfully start udpbroadcastrelay and my Sonos controller can now see the devices across subnets.
udpbroadcastrelay --id 1 --port 1900 --dev igb1 --dev igb2 --multicast 239.255.255.250 -d
Of course then I can't start miniupnpd again until the udpbroadcastrelay process is killed, so it seems the two are mutually exclusive, or at least when both are trying to use UDP 1900 (SSDP) on multicast address (239.255.255.250).
Other than moving the XBox or Sonos devices into their own VLAN, I can't see a workable solution here, but admittedly my IPv4 multicast knowledge is pretty basic.
Any further suggestions welcomed.
-
Yes, you can't have two processes listening on the same port like that. You can either relay the SSDP packets or accept and use them with UPnP. Or be more secure and do neither.
Steve
- 18 days later
-
Took a look at this as i was hoping it could help me overcome what PIMD seemingly could not, that is the initial discovery of SONOS devices on other VLANS. My set up was working fine once the controller had been connected to the SONOS VLAN and cached the ip addresses.
Unfortunately it does not. Followed what seems to be the fairly straightforward step by step guide by Qinn in post 55 and everything seems to work but nothing is discovered when i restart the pfsense.
Shellcmd per below
🔒 Log in to viewis there any way i can check it is properly running? other than SONOS detection working :)