What is this for?So I'm playing with Roon and I've got this complicated home network that throws Roon for a loop. I started debugging things and it turns out Roon sends broadcast messages to UDP/9003. My firewall/router will not forward these messages of course, because that's the right thing to do.Unfortunately, I really want these broadcast messages to be forwarded to other VLAN/subnets on my local network. I started using udp-proxy-relay-redux which worked great at first.But I also really like these messages forwarded over my OpenVPN connections which utilize the tun driver which is a point-to-point interface and explicity does not support broadcasts. This didn't work well with udp-proxy-relay-redux because Roon is poorly behaved and still tries sending "broadcasts" to the .255 address which are then dropped on the floor because my VPN server does not have the address x.x.x.255. Basically, on a point-to-point interface, these "broadcasts" were being treated as a packet destined to another host and rightfully ignored.So what does this do?Instead of using a normal UDP socket to listen for broadcast messages, udp-proxy-2020 uses libpcap to "sniff" the UDP broadcast messages. This means it can be a lot more flexible about what packets it "sees" so it can then sends them via libpcap/packet injection out all the other configured interfaces. If this makes you go "ew", well, welcome to 2020.The good news...I'm writing this in GoLang so at least cross compiling onto your random Linux/FreeBSD router/firewall is reasonably easy. No ugly cross-compling C or trying to install Python/Ruby and a bunch of libraries.Also: HAHAHAHAHAHAHA! None of that is true! Needing to use libpcap means I have to cross compile using CGO because gopacket/pcapgo only supports Linux for reading & writing to (ethernet?) network interfaces.
pfSense/BSD startup scriptsNote that these config files now support pfSense v2.5.0ConfigurationCreate /usr/local/etc/udp-proxy-2020.conf on your firewall and edit as necessary for your needs.Add the line udp_proxy_2020_enable=YES to /etc/rc.conf.local (file may need to be created)Copy over /usr/local/etc/rc.d/udp-proxy-2020Copy the correct udp-proxy-2020 binary for your system to /usr/local/bin/udp-proxy-2020 (yes, you have to rename the file!)Ensure that /usr/local/bin/udp-proxy-2020 and /usr/local/etc/rc.d/udp-proxy-2020 have the correct permissions by running: chmod 755 /usr/local/etc/rc.d/udp-proxy-2020 /usr/local/bin/udp-proxy-2020RunExecute (as root) service udp-proxy-2020 startOther infoThings to keep in mind:Tested to work with both Wiregard and OpenVPN on pfSense 2.6.0You may need to ssh into your firewall and run ifconfig to get the name of the VPN interfaceAdditional commands:Stop the service: service udp-proxy-2020 stopCheck status of the service: service udp-proxy-2020 status