Swarm-Scoped Macvlan Network Setup for Wyze Bridge and Workarounds for IOTC Error #1471
Replies: 2 comments 5 replies
-
@mrlt8 I was thinking that we might be able to adapt these instructions into more universal guidance that would benefit others e.g. for those running the Home Assistant add-on or other configurations. Broadening the scope could help users who are working in single Docker engine setups or even different networking architectures, all while leveraging the same underlying principles. Let me know if you'd be interested in collaborating on making these instructions more universally applicable. I’d love to help out in any way I can! Cheers, |
Beta Was this translation helpful? Give feedback.
-
Mind sharing some of your opnsense settings? I'm not sure what to put for the source address and broadcast address in the udp relay plugin. And maybe an example of the firewall rules you created? My LAN vlan can get to any other vlans as is, but I'm imaging I need to allow UDP dst 32761 from the vlan the cams are in. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Swarm-Scoped Macvlan Network Setup for Wyze Bridge
Hey everyone! I just wanted to share a detailed guide on how I set up a swarm-scoped macvlan network (with per-node IP ranges) for running Wyze Bridge in my Docker Swarm. It took a bit of trial and error, but once it all came together, it’s been rock solid, especially with OPNsense handling broadcast relays for Wyze discovery packets.
Note: This guide reflects the approach that worked for me within a Docker Swarm environment. The underlying concepts of macvlan networking, per-node IP management, and broadcast relaying can be distilled down to a single Docker engine setup or adapted to other networking architectures.
Below is an overview that walks through everything from macvlan creation to container deployment, plus a note on how I got broadcasts working across VLANs in OPNsense. Let me know if you have any questions!
Why a Per-Node macvlan Setup?
Step 1: Clean Up Old Networks
First, I removed any existing
macvlan_local
ormacvlan_swarm
from each node, just to start fresh. You can safely skip this if it’s your first time:Step 2: Create Local (Config-Only) macvlan Networks on Each Node
On each node, I created a config-only network that defines the unique IP range it should hand out. You can split your subnet by node and role (manager vs. worker). For example:
Manager Node 00 (10.40.0.0/24):
docker network rm macvlan_local 2>/dev/null docker network create \ --driver macvlan \ --subnet=10.40.0.0/21 \ --ip-range=10.40.0.128/27 \ --gateway=10.40.0.1 \ --opt parent=enp6s19 \ --config-only macvlan_local
Worker Node 00 (10.40.0.0/24):
docker network rm macvlan_local 2>/dev/null docker network create \ --driver macvlan \ --subnet=10.40.0.0/21 \ --ip-range=10.40.0.160/27 \ --gateway=10.40.0.1 \ --opt parent=enp6s19 \ --config-only macvlan_local
Repeat for every node, adjusting subnet slices as needed.
Step 3: Create the Swarm-Scoped macvlan Network
Once all nodes have their own
macvlan_local
, I created a single swarm-scoped network (I did this on a manager node):docker network rm macvlan_swarm 2>/dev/null docker network create \ --driver macvlan \ --scope swarm \ --config-from macvlan_local \ --attachable \ macvlan_swarm
This sets up a global network called
macvlan_swarm
that references each node’s local IPAM config. Any container that joinsmacvlan_swarm
on a given node automatically gets an IP from that node’s local range.Example Service: Wyze Bridge
Below is a snippet from my
docker-compose.yml
(Swarm stack file). I attach the container tomacvlan_swarm
so it has a VLAN IP, and also to other internal networks for things like Traefik reverse proxying.This setup makes it very easy to scale Wyze Bridge across multiple nodes while keeping each instance on the same VLAN but with distinct IPs.
OPNsense: UDP Broadcast Relay for Wyze Discovery
I’m using OPNsense with the UDP Broadcast Relay plugin to forward Wyze discovery packets (UDP port 32761) between the VLAN that my cameras live on and the VLAN used by the macvlan network. You just need to:
That way, Wyze Bridge can detect and communicate with cameras despite being on a different VLAN.
Verifying
"Scope": "swarm"
and"ConfigFrom": { "Network": "macvlan_local" }
.Final Thoughts
This approach has been rock solid for me. Per-node IP management plus a swarm-scoped macvlan network keeps everything tidy and flexible. While this guide is based on my Docker Swarm configuration, the underlying concepts are versatile enough to be applied to a single Docker engine setup or other networking architectures. If anyone runs into snags or has any improvements, please jump in.
Hope this helps someone else as they tackle similar Docker Swarm + VLAN setups with Wyze Bridge. Feel free to fire away with any questions or ideas, and I’m happy to share more about my configuration details if needed.
Beta Was this translation helpful? Give feedback.
All reactions