posted in Selfhosted

Simplest VLAN setup?

I’m moving soon and planning some overhauls to our home lab and local network.

We have security cameras and I really want them on their own VLAN without internet access. Then I got even more ambitious and decided I want to separate a lot of things into different VLANs without internet access, but can still talk to each other.

My long term goal will be to have an OPNsense box that I can do even more intricate network configs with, however in the short term I don’t think I can afford the hardware to do so. So for now, I’m trying to find the simplest, ideally cheapest way to implement at least one VLAN in my local network.

My ISP’s router will not support it, however should support bridge mode. So I’m thinking the easiest way is to buy a VLAN capable router and pass through to it, however I’m still new to this and learning as I go.

Curious if anyone here has VLAN tips, tricks, or suggestions for a cheap/easy setup.

Cheers!

Replying to an earlier post

Short answer: Don’t buy a VLAN capable router just yet. Buy a VLAN capable switch first, and then you can reevaluate.

Longer answer: VLANs have been a major part of my career for the past 20 years, and it seems that a very common thing I need to teach people joining me at work is this: Switches don’t provide access between VLANs. Routers do. But that doesn’t necessarily mean that the router needs to know about VLANs.

Sure, it’s reasonably obvious to many, and there are exceptions, but a very common question I get is how one can set up VLANs so that some hosts can talk to each other across VLANs.

There are many ways to set up VLANs, but I find it easiest to number a VLAN based on an octet in the IP scope of its clients. For example:
172.20.32.0/24 gets VLAN 32
172.20.40.0/24 gets VLAN 40
…etc

And then you plug a router into each of those VLANs and set up firewall rules according to your preferences. The router can be connected via a single trunk cable (if it supports VLAN tagging), or if you’re lazy or your router is too dumb, you use a dedicated interface/cable for each VLAN via Access ports instead and segregate them via subnets.

So back to your question: Put your cameras on an isolated VLAN, provide that VLAN with a gateway, and then you config the gateway to block its internet traffic, but allow access between your camera vlan and some (or all) hosts on your other subnets/vlans.
A decent VLAN capable switch will let you do this, and on the router side you just treat these VLANs as physically separate networks.