Get Google Speaker Groups and Sonos to work on separate VLANs
If you have made the smart decision of placing IoT devices on a separate VLAN you may notice that Google Speaker Groups, Sonos and many other systems do not work. This is due to the fact the UDP Broadcast is not reaching the other VLAN’s.
What we'll achive:
- Setup UDP Broadcast Relay
What you need:
- pfSense terminal or a Linux Box/VM which is on both VLAN's
The following instuctions will be aimed at a Ubuntu System.
Install
- Update Linux
sudo apt update && sudo apt upgrade
- Make sure Git is installed
sudo apt install git
- Download the GitHub Repo
git clone https://github.com/udp-redux/udp-broadcast-relay-redux
- Enter the Directory
cd udp-broadcast-relay-redux
- Install make
sudo apt install make && sudo apt install gcc
- Make the executable
make
- Run the executable
sudo ./udp-broadcast-relay-redux --id 1 --port 5353 --dev <NIC1> --dev <NIC2> --multicast 224.0.0.251 -s 1.1.1.1 -f
Create service to start on boot (Optional)
- Create systemd service
sudo nano /etc/systemd/system/udp-broadcast-relay.service
Use this as a template:
[Unit]
Description=UDP Broadcast Relay
[Service]
ExecStart=<PATH> --id 1 --port 5353 --dev <NIC1> --dev <NIC2> --multicast 224.0.0.251 -s 1.1.1.1 -f
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
PATH = Path to the executable e.g. /home/USER/udp-broadcast-relay-redux/udp-broadcast-relay-redux
NIC1 = Network Adapter name e.g. eth0
NIC2 = Network Adapter name e.g. eth1
Tip: Show all NIC's on Linux with ip addr show
- Start Service
sudo systemctl start udp-broadcast-relay.service
- Enable at boot
sudo systemctl enable udp-broadcast-relay.service
Sources:
https://github.com/udp-redux/udp-broadcast-relay-redux
https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6
Cover Image Credit: https://unsplash.com/@galex