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!

  • neidu4@piefed.social
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    8 hours ago

    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.

    • remotelove@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours ago

      Yes to all of this. Learning the switch bit is probably harder than setting up opnsense. With opnsense, it’s just building the VLANs on your interfaces and the routing is automagic.

      With switches, there are nuances like PIVDs, tagging and untagging along with trunks. It’s not that hard, but it can be difficult to visualize at first.

      I still love not having to constantly move cables around though. Even though it’s literally just across my office, I plugged in 8 cables from my servers today into 8 empty switch ports and that was that. Everything weird and crazy I might do is going to be all handled by VLANs, routing and firewall rules and the cables still get to look nice while that happens.

      I just started segmenting my wifi network and isolating all the IoT trash off into its own little corner letting all those thingies just broadcast at each other instead of the rest of my network…