Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How can I get this UDP relay package for casting across VLANs?

    Scheduled Pinned Locked Moved pfSense Packages
    123 Posts 21 Posters 57.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tman222 @Qinn
      last edited by tman222

      @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) is 12345, 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.

      QinnQ 1 Reply Last reply Reply Quote 1
      • QinnQ
        Qinn @tman222
        last edited by Qinn

        @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) is 12345, 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
        

        Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
        Firmware: Latest-stable-pfSense CE (amd64)
        Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

        1 Reply Last reply Reply Quote 0
        • QinnQ
          Qinn @stephenw10
          last edited by Qinn

          @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

          Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
          Firmware: Latest-stable-pfSense CE (amd64)
          Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            The feature request is open, add your comments there:
            https://redmine.pfsense.org/issues/10818

            It's certainly relatively simple. There is a fine line between elegant and crude. 😉

            Hard to argue with what works though.

            Steve

            QinnQ 1 Reply Last reply Reply Quote 3
            • QinnQ
              Qinn @stephenw10
              last edited by

              @stephenw10 Nice

              Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
              Firmware: Latest-stable-pfSense CE (amd64)
              Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

              1 Reply Last reply Reply Quote 0
              • QinnQ
                Qinn
                last edited by Qinn

                @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 ?

                Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
                Firmware: Latest-stable-pfSense CE (amd64)
                Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • QinnQ
                    Qinn
                    last edited by

                    Aha so it's shellcmd related

                    Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
                    Firmware: Latest-stable-pfSense CE (amd64)
                    Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

                    1 Reply Last reply Reply Quote 0
                    • S
                      shremi
                      last edited by

                      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 .

                      T 1 Reply Last reply Reply Quote 1
                      • T
                        tman222 @shremi
                        last edited by

                        @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.

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          shremi @tman222
                          last edited by

                          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 .

                          QinnQ 1 Reply Last reply Reply Quote 0
                          • QinnQ
                            Qinn @shremi
                            last edited by Qinn

                            @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 with

                            chmod 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

                            Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
                            Firmware: Latest-stable-pfSense CE (amd64)
                            Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              shremi @Qinn
                              last edited by shremi

                              @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
                              

                              shellcmd.png

                              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.

                              IOT Rules.png

                              But still no connection via the app.

                              I am sure i am missing something.

                              S 1 Reply Last reply Reply Quote 0
                              • S
                                shremi @shremi
                                last edited by

                                @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.

                                QinnQ 1 Reply Last reply Reply Quote 0
                                • QinnQ
                                  Qinn @shremi
                                  last edited by Qinn

                                  @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
                                    Firefox_Screenshot_2020-10-25T08-20-33.737Z.png

                                  • Then install putty https://www.putty.org/ and enable SSH in pfSense and login with SSH

                                  Hardeware: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz 102 GB mSATA SSD (ZFS)
                                  Firmware: Latest-stable-pfSense CE (amd64)
                                  Packages: pfBlockerNG devel-beta (beta tester) - Avahi - Notes - Ntopng - PIMD/udpbroadcastrelay - Service Watchdog - System Patches

                                  1 Reply Last reply Reply Quote 1
                                  • G
                                    GeorgeCZ58
                                    last edited by

                                    Thanks, this help me to get working control of my devices between VLANs.

                                    1 Reply Last reply Reply Quote 0
                                    • L
                                      LamaZ @burntoc
                                      last edited by

                                      @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)
                                      1 Reply Last reply Reply Quote 1
                                      • G
                                        girkers
                                        last edited by

                                        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:

                                        078f2557-f451-472e-bc32-9fd059de0641-image.png

                                        1 Reply Last reply Reply Quote 4
                                        • S
                                          sfxdude
                                          last edited by

                                          In case this helps anyone, I built this on freeBSD 12.2 for pfsense 2.5.0:
                                          udpbroadcastrelay-pfsense2.5.0.zip

                                          ? T 2 Replies Last reply Reply Quote 3
                                          • ?
                                            A Former User @sfxdude
                                            last edited by

                                            @sfxdude Thank you! I was just sitting down to spin up a VM to build this for 12.2. You saved me the time.

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.