xannor / ha_reolink_discovery

ReoLink Discovery Protocol Integration for Home Assistant
Apache License 2.0
10 stars 1 forks source link

VLAN Setup #2

Open LordNex opened 2 years ago

LordNex commented 2 years ago

Question, my network consists of several different VLANs for network segmentation. Can I reference multiple broadcast addresses, one for each subnet, or would I need to add multiple instances? How is that handled. Eventually I plan on putting them all on their own VLAN but right now they are spread out a cross several subnets. I have good enterprise grade layer 3 LAN/WLAN so inter-VLAN routing won't be an issue.

LordNex commented 2 years ago

I guess I could use something like 192.168.255.255 as the broadcast, but that would send a lot of unwanted traffic. I tried doing comma delimited but just received an error.

xannor commented 2 years ago

I had only built it to allow overriding the default broadcast address, in the situation where the internal ip address is not the same as the ip address bound to the instance (i.e. docker containers.) by default it does use the network broadcast addresses for the known interfaces, so if your instance was bound to multiple ip addresses on each segment it would, by default, get a broadcast address for each.

I hadn't thought of allowing for multiple ip addresses, though that should be do-able.

LordNex commented 2 years ago

Yea basically I have Home Assistant on a PowerEdge R620 running in a VMWare ESXi 7 Container. All 4 of its interfaces are bound together at the network layer with LACP so the host OS only sees one network card that's 4Gbps. I then used VMwares Vietual Switch to create a network interface on each of my VLANs. This get passed to Home Assistant as 5 separate interfaces, one on each VLAN subnet I have. That way it can scan and control devices in each subnet without having to traverse layer 3 or the firewall.

So my setup looks like this in HA

image

So ultimately I'd like to have the ReoLink discovery run on each broadcast address home assistant uses. Currently I have it set to the default interface there with the star.

LordNex commented 9 months ago

I have a ticket out there for this

xannor commented 9 months ago

On a side note, the only two advantages this integration provides, are 1) the ability to detect older reolink cameras that were built using stock components (I have a 511W that uses as generic WiFi so the regular integration cannot detect it as it detects by MAC) and 2) the ability to detect camera's that are on a separate subnet that does not dhcp broadcast to the one the device is on.

Unless you are in one of these situations, this addon really provides nothing and instead is wasting cpu and network resources as the udp packets are chatty.

LordNex commented 8 months ago

Quesrion: doesn't utilize mDNS or SSDP to detect other devices on other VLANs. My distribution switch is layer 3 and has DHCP relay enabled, as well as my wireless cluster a has an SVI for each IAP in each VLAN and also utilized a DHCP relay via a centralized DHCP tied to each SSID I've attached to each VLAN. Which in methodology and practice works great. I've even done huge networks like this with High Availability running through FortiNet Firewalls clustered and fiber channeled to the central network Cisco Distribution Switch controller when then branches out to individual switches in various locations. All with Aruba IAPs attached and functioning in the same way.

xannor commented 8 months ago

No, the "ping/pong" method that the camera's use is a udp broadcast to port 2000 and listens for replys on udp port 3000. The HA integration uses DHCP broadcasts and the MAC prefix that most current cameras have for their network interfaces (some older wifi ones use generic devices.)

LordNex commented 8 months ago

No, the "ping/pong" method that the camera's use is a udp broadcast to port 2000 and listens for replys on udp port 3000. The HA integration uses DHCP broadcasts and the MAC prefix that most current cameras have for their network interfaces (some older wifi ones use generic devices.)

Ok makes sense. Mine consistently try and open forward ports in my firewall with uPNP, which I want on for my Xbox's, but the camera doesn't need too. I use the HA integration mainly as a sensor and stream everything through my Frigate server with a Coral TPU attached. Might just be easier to have a dedicated video VLAN for the primary cameras, NVR and AI core. Then just allow the ports for RTMP and MQTT portions to hop the VLAN at the router. Should give me about the same solution while properly segmenting the video network and its intranet communications.

Might have to move some of my integrations around and or build separate docker server for them. Currently I only have 1 of my RCL520a's PoE'd into the network. As soon as the weather gets warmer (Midwest USA) I plan on burring a CAT7 out to my garage and installing a new PoE switch there. It'll have most of the cameras as I can see most of what I need to for that.

Can't find anyone brave enough to climb my 70 foot tower to install a 360 dome camera and weather station yet. Well not at a price I'm willing to accept. LOL