| Post Reply | RetroFed Forum Forum Index » Selfhosted |
| Author | Message | ||
|---|---|---|---|
|
lemmyvore
feddit.nl
lemmyvore@feddit.nl Joined: 2023-06-15 |
Having fought for several days with this, I'd thought it would be worth sharing while it's still fresh in what's left of my mind: Problem:
Network topology:
Configuring the VLANs in OpenWRT: Before anything else: try doing the next batch of configs from wireless if possible not Ethernet, in case you mess up and lose wired connectivity to the router.
If all went well and you're on wireless or one of the untagged Ethernet ports (lan2 or lan4) you should have retained connectivity to the router and wireless devices. Configuring the NVR network in OpenWRT:
Configuring the camera:
Configuring the server for tagged VLAN connectivity:
Configuring docker networks and containers:
Bibliography:
|
||
| 82 Original | |||
|
IrateAnteater
sh.itjust.works
IrateAnteater@sh.itjust.works Joined: 2023-09-07 |
Networking headaches are the main reason why I've done everything I can to get away from docker. I've had easier times spinning up an LXC container and building from source than I have had fighting with docker networking. |
||
| 10 | |||
|
lemmyvore
feddit.nl
lemmyvore@feddit.nl Joined: 2023-06-15 |
Networking headaches are the main reason why I've done everything I can to get away from docker. I've had easier times spinning up an LXC container and building from source than I have had fighting with docker networking.
In this particular case it wasn't Docker that gave me the headaches, it was OpenWRT and wrapping my head around tagged VLANs. Once you have the VLANs working on the router and the tagged interfaces up on the server, pointing a Docker network or an LXC at the Now, when I first got the camera I was considering adding a secondary network card to the server and plugging the camera into that, so it would be directly hardwired into the machine running the NVR. If I had done that I was given to understand that taking ownership of a physical NIC would have been much easier with LXC than with Docker. (We'll never know because I couldn't find the PCI network card.) |
||
| 7 | |||
|
hendrik
palaver.p3x.de
hendrik@palaver.p3x.de Joined: 2021-08-21 |
Interesting. Any reason to prefer the driver-level VLANs over the hardware switch? That's how I've done it in the past, and also how the linked wiki article starts. |
||
| 2 | |||
|
Archer
lemmy.world
Archer@lemmy.world Joined: 2023-06-12 |
Interesting. Any reason to prefer the driver-level VLANs over the hardware switch? That's how I've done it in the past, and also how the linked wiki article starts.
So you don’t need a hardware switch |
||
| 2 | |||
Possibly linux
lemmy.zip
possiblylinux127@lemmy.zipJoined: 2023-06-26 |
This is a bit more complex that it needs to be Why didn't you just use the openwrt Firewall? Admittedly I just skimmed this but couldn't just allowed your server to talk to the camera via a Firewall rule? |
||
| 6 | |||
|
unitedwithme
lemmy.today
unitedwithme@lemmy.today Joined: 2026-04-09 |
I'm going to go out in a limb and die on it, that: why overcomplicate things with Docker containers?? I didn't read through your post; The title, to me, doesn't require it based on what you're doing. I then read you're Problem box and confirmed you don't need NVR on Docker. Seems overkill or really, pointless. A. Do you absolutely NEED the VLAN for your NVR? Why not just isolate the devices on the network with a bogus DNS record or FW rule blocking via MAC or IP? Idk, you do you. I'm SURE I'll get hate for this comment, but sometimes you need to take a steep back and think about what's necessary vs what's for fun for learning. I'd you can, hey great! If you can't, or it breaks, how much time do you now want to spend learning how to troubleshoot? |
||
| 3 | |||
Possibly linux
lemmy.zip
possiblylinux127@lemmy.zipJoined: 2023-06-26 |
In this particular case it wasn't Docker that gave me the headaches, it was OpenWRT and wrapping my head around tagged VLANs. Once you have the VLANs working on the router and the tagged interfaces up on the server, pointing a Docker network or an LXC at the eth0.100 interface is equally easy. Now, when I first got the camera I was considering adding a secondary network card to the server and p...
Are you familiar with the OSI model? I would learn layer 2 vs layer 3 before getting to far in the weeds |
||
| 3 | |||
Possibly linux
lemmy.zip
possiblylinux127@lemmy.zipJoined: 2023-06-26 |
Interesting. Any reason to prefer the driver-level VLANs over the hardware switch? That's how I've done it in the past, and also how the linked wiki article starts.
I'm not sure what you mean by "driver level." Configuring vlans in openwrt will configure the hardware. (It is really the Linux kernel that does the heavy lifting) |
||
| 2 | |||
|
GreenKnight23
lemmy.world
GreenKnight23@lemmy.world Joined: 2024-09-21 |
I'm going to go out in a limb and die on it, that: why overcomplicate things with Docker containers?? I didn't read through your post; The title, to me, doesn't require it based on what you're doing. I then read you're Problem box and confirmed you don't need NVR on Docker. Seems overkill or really, pointless. A. Do you absolutely NEED the VLAN for your NVR? Why not just isolate the devices on ...
DNS doesn't stop direct IP comms. I have seen a few devices that talked direct IP to bypass DNS blocks. as you said, a firewall rule is a far better solution. However, I don't trust my Chinese cameras enough to not rootkit their way across my network, so it has to be quarantined. a VLAN is one way to successfully do that. personally I dislike the high maintenance costs of VLANs. That's why I opted to run a completely different network for all my IOT devices including cameras. the DVR is on that network and proxied through a dual homed server that straddles the two networks. firewall rules in place that only allow specific ports through on specific devices to specific devices. |
||
| 5 | |||
|
hendrik
palaver.p3x.de
hendrik@palaver.p3x.de Joined: 2021-08-21 |
I'm not sure what you mean by "driver level." Configuring vlans in openwrt will configure the hardware. (It is really the Linux kernel that does the heavy lifting)
I don't really know, either. "driver-level VLAN" is the terminology the OpenWRT wiki (linked) uses. Seems OP went for the strategy at the bottom, with going to the bridge settings and make it add a new interface. What I've done before, and what that article talks about at the top is, go to the Switch settings instead, and set the port to the corresponding VLAN, or to keep the tags... But maybe I misremember what I did and which settings I touched... Yet it seems to me those are two distinct ways of doing it. Either on the switch hardware inside of the OpenWRT device, or inside of the software bridge in OpenWRT. https://openwrt.org/docs/guide-user/network/vlan/switch_configuration |
||
| 1 | |||
|
corsicanguppy
lemmy.ca
corsicanguppy@lemmy.ca Joined: 2023-06-12 |
A. Do you absolutely NEED the VLAN for your NVR? Why not just isolate the devices on the network with a bogus DNS record or FW rule blocking via MAC or IP? DNS doesn't stop direct IP comms. I have seen a few devices that talked direct IP to bypass DNS blocks. as you said, a firewall rule is a far better solution. However, I don't trust my Chinese cameras enough to not rootkit their way across m...
Said no one ever, until now. |
||
| 2 | |||
|
GreenKnight23
lemmy.world
GreenKnight23@lemmy.world Joined: 2024-09-21 |
high maintenance costs of VLANs Said no one ever, until now.
a VLAN is assigned to a specific port on the same subnet. now I have to know which port is for that VLAN specifically. now I have to segment my network to ensure I know which IPs are on that VLAN. now I have to statically assign IPs. now I need to replace my router and rebuild everything. or I setup a separate network on a different subnet with firewall rules to ensure nothing can talk to anything outside of the private network and let dhcp do assignments. hmmmm.....which one is easier to maintain.... I wonder... VLANs literally exist because it would be too costly to run dedicated networking hardware in enterprise solutions. from a networking perspective in a selfhosting or small business environment VLANs are overkill and high maintenance. |
||
| -1 | |||
|
lemmyvore
feddit.nl
lemmyvore@feddit.nl Joined: 2023-06-15 |
This is a bit more complex that it needs to be Why didn't you just use the openwrt Firewall? Admittedly I just skimmed this but couldn't just allowed your server to talk to the camera via a Firewall rule?
I did initially do it with the firewall alone. I created a "br-nvr" device, moved lan1 from br-lan to it, and used br-nvr as the device for the NVR interface and firewall zone, then selectively let my phone and the NVR app from the LAN zone access the camera ports with traffic rules. Everything else about the interface and zone stayed the same as they are now. That's what's great about the OpenWRT abstractions. I really appreciated how easy it was to get things working with the firewall zones alone, don't get me wrong. The one major issue with that approach was that the NVR app is outside the NVR zone and I wanted it in there.
With the NVR app in the same isolated network as the cameras they can do whatever they want in there without needing explicit rules. But I couldn't put the NVR docker container into the NVR network, because it lives on a machine on the LAN network, and you can't have the host machine on one network and a app on it in another network, with a single physical cable... unless you use tagged VLANs. There are also some potential annoyances in the future if I ever want to move cables around the ports or make more complex setups, the VLAN abstraction makes things easier. |
||
| 2 | |||
|
lemmyvore
feddit.nl
lemmyvore@feddit.nl Joined: 2023-06-15 |
Interesting. Any reason to prefer the driver-level VLANs over the hardware switch? That's how I've done it in the past, and also how the linked wiki article starts.
I'm not an expert so take this with a grain of salt, but it seemed to me that the driver approach is the more useful abstraction and also the more modern, and that the old one will get eventually phased out (or stay there under the hood, out of the way). I did see that some tutorials started out with "figure out if you have a hardware switch" but this way I didn't have to care. |
||
| 1 | |||
|
lemmyvore
feddit.nl
lemmyvore@feddit.nl Joined: 2023-06-15 |
I'm going to go out in a limb and die on it, that: why overcomplicate things with Docker containers?? I didn't read through your post; The title, to me, doesn't require it based on what you're doing. I then read you're Problem box and confirmed you don't need NVR on Docker. Seems overkill or really, pointless. A. Do you absolutely NEED the VLAN for your NVR? Why not just isolate the devices on ...
Tagged VLANs would be needed regardless, because I have only one server with one physical connection and I wanted to have processes on it on 2 different networks. Docker is neither here nor there, you're right it's not needed for the solution. I was using it anyway, I know lots of selfhosters do, and it does make it easy to create an ipvlan and put an app on it. Docker is not the only way to achieve containerization but I do appreciate and use containerization (and virtualization). It lets the host OS stay simpler and cleaner and prevents the various apps from messing with it. It makes it easy to control each app's environment. You can do app containers, system containers or VMs as needed. It makes it easy to back up, restore and reproduce an app and its state, independently of the host OS or any other app. Abstractions help... they empower you to do more. You invest some time into learning, sure, but it pays off later in time saved managing and the ability to do more complex stuff faster. Troubleshooting is what it is. Nothing's perfect, you're going to end up troubleshooting something sometime not matter what you use. |
||
| 2 | |||
|
unitedwithme
lemmy.today
unitedwithme@lemmy.today Joined: 2026-04-09 |
a VLAN is assigned to a specific port on the same subnet. now I have to know which port is for that VLAN specifically. now I have to segment my network to ensure I know which IPs are on that VLAN. now I have to statically assign IPs. now I need to replace my router and rebuild everything. or I setup a separate network on a different subnet with firewall rules to ensure nothing can talk to anyth...
On older hardware I would agree it can be cumbersome. At work, I've swapped everything to Ubiquiti and it's a couple clicks and I'm there. I liked it so much I did it at home with some caveats. Local account only and blocking anything phoning home. I've got Chinese cameras too, they're on their own VLAN,ext traffic is blocked simply. |
||
| 1 | |||
czardestructo
lemmy.world
czardestructo@lemmy.worldJoined: 2023-06-10 |
The NVR doesnt have to live in the same VLAN if you give it explicit firewall rules to traverse to the tainted camera VLAN for the explicit purpose of fetching the rtsp stream from the cursed cameras. Its how I setup my network. The cameras are islanded, I setup Frigate to be allowed to go in and open that port over TCP. The cameras try to phone home and pull DNS but are ignored, only traffic they're allowed to product is rtsp to Frigate. |
||
| 2 | |||
Possibly linux
lemmy.zip
possiblylinux127@lemmy.zipJoined: 2023-06-26 |
I did initially do it with the firewall alone. I created a "br-nvr" device, moved lan1 from br-lan to it, and used br-nvr as the device for the NVR interface and firewall zone, then selectively let my phone and the NVR app from the LAN zone access the camera ports with traffic rules. Everything else about the interface and zone stayed the same as they are now. That's what's great about the Open...
Thanks for the clarification |
||
| 1 | |||
Possibly linux
lemmy.zip
possiblylinux127@lemmy.zipJoined: 2023-06-26 |
I don't really know, either. "driver-level VLAN" is the terminology the OpenWRT wiki (linked) uses. Seems OP went for the strategy at the bottom, with going to the bridge settings and make it add a new interface. What I've done before, and what that article talks about at the top is, go to the Switch settings instead, and set the port to the corresponding VLAN, or to keep the tags... But maybe ...
OpenWRT now uses DSA so that article is dated. The old switch menu doesnt exist outside of a handful of devices |
||
| 2 | |||
|
hendrik
palaver.p3x.de
hendrik@palaver.p3x.de Joined: 2021-08-21 |
OpenWRT now uses DSA so that article is dated. The old switch menu doesnt exist outside of a handful of devices
Thanks! You're right. Seems it's distributed switch architecture on my wifi router. I used Luci to configure it. Didn't even know this was more than a UI change... |
||
| 1 | |||
|
Lem453
lemmy.ca
Lem453@lemmy.ca Joined: 2023-06-09 |
I did this using a POE switch to both power the cameras and also have that entire switch on a VLAN. On my OPNSense, that vlan only has permission to send or recieve packets to home assistant which is on my main LAN. They have no other access to anything including each other on the camera vlan. Other than the initial setup, the only interaction I have with the cameras is via home assistant. This allows them to be completely isolated and still have remote access as per usual with home assistant. My HA is using the all in one VM setup on Proxmox. I would highly recommend HA installed as a VM rather than Docker due to the ease if installing plugins. After that the above setup will keep your IOT devices nicely isolated. |
||
| 1 | |||
|
non_burglar
lemmy.world
non_burglar@lemmy.world Joined: 2023-06-16 |
I did initially do it with the firewall alone. I created a "br-nvr" device, moved lan1 from br-lan to it, and used br-nvr as the device for the NVR interface and firewall zone, then selectively let my phone and the NVR app from the LAN zone access the camera ports with traffic rules. Everything else about the interface and zone stayed the same as they are now. That's what's great about the Open...
I think you might be misunderstanding the role of a firewall. Put your camera in another subnet, add rules at the convergence point (the router, in this case), done. That is effectively what you're doing with VLANs anyway. |
||
| 1 | |||
|
lemmyvore
feddit.nl
lemmyvore@feddit.nl Joined: 2023-06-15 |
I think you might be misunderstanding the role of a firewall. Put your camera in another subnet, add rules at the convergence point (the router, in this case), done. That is effectively what you're doing with VLANs anyway.
I want to have a device (the server) present in multiple networks (and multiple different firewall zones) at the same time. I was given to understand I need tagged VLANs for this. I tried doing it with zones only but I couldn't. |
||
| 1 | |||
| Post Reply |
Back to top |