Why I Put My Smart Devices in a Digital Cage: A Homelab Security Journey

A well-organized home server setup with network equipment and cables

"You will own nothing and be happy." The rat race of competing streaming services leaves you either missing out on your favorite shows or paying multiple subscriptions. The "Stop Killing Games" movement is a perfect example of this growing frustration, a feeling we saw again when Sony announced it would be removing purchased Discovery content from users' PlayStation libraries. Once their license agreement has ended, the content disappears, yet you're still left paying the bill.

Another big issue for me is the intrusion of privacy with some of the modern consumer hardware we use every day. The hardware in our homes is actively working against us. The smart TV in your living room might be spying on you. It's not a conspiracy theory, but a controversial marketing strategy. Using tech like Automatic Content Recognition (ACR), it fingerprints everything you watch and sells that data to advertisers. The FBI has even warned that hackers can take over its camera and microphone.

Feeling like I didn't truly own my data and facing clear security concerns, I had to come up with a solution that could tackle both issues. After watching one too many YouTube videos of other people's slick home lab setups, I dove head-first into the rabbit hole of building a secure home network.

Server Requirements

I didn't waste time immediately shooting for the "perfect" setup. My experience learning to code has made me fearless and curious in the face of the unknown. The fastest way for me to learn new concepts quickly is to get my hands dirty and build something. I wanted to build a server that could work as a NAS: a central place to hoard my favorite movies, shows, photos, music, and any other data that was precious to me. I needed to be able to access this data across trusted devices in my network using SMB and NFS shares. Lastly, I needed some Docker containers to self-host applications that would serve as my alternative to streaming services and the ability to spin up VMs for experimenting without fear of breaking something.

Proof of Concept

I used an old desktop PC I had built years ago and installed Unraid OS on it. I chose Unraid over popular alternatives like TrueNAS mainly due to the Parity setup over a typical RAID setup. Essentially, the largest hard drive is the "parity" drive, which acts as my redundancy. I can mix and match hard drives of different storage sizes to increase my total storage capacity. If one hard drive fails, I can simply replace it, and the parity drive will populate the replacement drive with the data that was originally on the failed one. The catch is that your largest hard drive has to be the parity drive, and one parity drive can only handle one drive failure. If more than one drive fails, data is lost. Unraid currently allows up to two parity drives to be able to handle two drive failures at a time. There are always going to be trade-offs with any setup, and it should be tailored to best suit the requirements of its use case.

It was a glorious mess! A half-broken PC case with a bird's nest of excess power supply wires sticking out. But it worked, and I spent a week messing with the software, getting comfortable with my new environment. It gave me a taste of real ownership, and I was hooked.

Forging the Digital Cage

With a newfound understanding of how to properly set up my server, I still had to figure out how to keep IoT devices in their own bubble, oblivious to any trusted devices connected to my network. That's when I started digging deep into VLANs. My consumer-grade router wasn't cutting it. You could set up a guest network and even an IoT network, but it was still very limiting for my needs. As a security-minded professional, I was at the mercy of the proprietary software the router ran on. It's closed source, so I can't see what's going on, and who knows when the next update will be.

I decided on using OPNsense installed on a low-power mini PC. OPNsense is robust NGFW software that is open-source and gives me ultimate control. You can install OPNsense on any x86 PC that meets the minimum requirements. I went ahead with the purchase of a mini PC mainly because I had run out of hardware to repurpose and wanted to replicate the familiar size and low power draw I was accustomed to. I found this video from the YouTube channel apalrd's adventures to be a good walkthrough for the initial setup of OPNsense.

While you can add a Wi-Fi card to the OPNsense box, it is generally recommended to use a dedicated wireless access point for simplicity and greater wireless coverage. In the spirit of recycling and repurposing old hardware, there is an option in my old router's software to effectively operate as a wireless access point, forgoing any firewall features. Later, when I build my true setup, I'll incorporate a managed network switch to set up VLAN tagging for devices connected via Ethernet.

That messy proof-of-concept sparked the plan for a permanent solution. This post is the story of moving from that pile of salvaged parts to a full-fledged digital fortress.

From MVP to Production (Rebuilding for a More Permanent Solution)

A fortress needs strong walls and a smart gatekeeper. Here are the core components I chose for the build, focusing on their role in the system.

The Setup: Network Architecture & Key Configurations

This is where the magic happens. The hardware is just a pile of parts until you define the architecture. My setup is built on the security principle of segmentation, using VLANs (Virtual Local Area Networks) to create separate, isolated networks for different types of devices.

Network Diagram

(A diagram showing the different VLANs and how devices connect.)

Firewall Software: OPNsense - The Rulebook for the Fortress

For the brain of my network, a standard consumer router's firmware wasn't going to cut it. I needed granular control. I chose OPNsense, a professional-grade, open-source firewall and routing platform based on FreeBSD. While pfSense is another popular option, I was drawn to OPNsense's modern user interface and its strong focus on security with frequent, consistent updates. It gives me the power to build the "digital cages" exactly how I want, with no compromises.

The core of the setup involves two key steps inside OPNsense:

1. Creating the VLANs:

First, I defined the virtual networks. Under Interfaces > Other Types > VLAN, I created three separate networks, each with a unique numeric tag:

Each VLAN was then assigned to its own logical interface, which lets OPNsense treat it like a separate physical network port. I then enabled a DHCP server for each one to hand out IP addresses to devices.

2. Crafting the Firewall Rules:

This is where I enforce the separation. In OPNsense, firewall rules are processed from top to bottom on each interface, and the first rule that matches a packet wins. My philosophy is simple: Block by default, then explicitly allow only what is necessary.

Here’s a simplified look at the rules for the IoT VLAN (The Cage), which is the most critical:

This setup ensures that even if a smart TV or other IoT device gets compromised, the attacker is trapped inside the cage and can't move laterally to attack my more important devices.

The Software Stack: Services Inside the Fortress

Hardware is only half the battle. The real power of a home lab comes from the software you run on it. My goal was to replace paid subscription services and take back control of my data, so my software choices reflect that.

The Server OS: Unraid

The Container Engine: Docker

File Sharing: SMB and NFS

Remote Access: SSH

The Core Services:

The Payoff: Challenges & Lessons Learned

No project like this is ever a straight line. The real learning doesn't come from when things work; it comes from when they break. Here are a few key takeaways from the trenches.

Reading about network theory is one thing. Nothing teaches you faster than breaking your own network at 11 PM on a Tuesday and having no one to blame but yourself.

Network Visualization

Here's a look at the evolution of my network setup and the physical hardware that makes it all possible:

Current Network Architecture

Current network setup
Visual representation of my current network segmentation and traffic flow

Server Hardware

NAS server exposed
The physical server hardware that powers my self-hosted services

Internal Components

NAS internals
Inside the server: hard drives, cooling, and cabling that make it all work

Take Back Your Network

This project was about more than just building a server; it was about taking back control. By building this digital fortress, I've not only shielded my personal data from prying eyes but also created an invaluable sandbox. This lab is where I test security tools, break applications, and practice incident response—skills that are critical in the AppSec field and that you can't learn from a textbook.

You don't need a 12U rack to get started. The most powerful tool I used was a repurposed desktop PC from years ago. Start there. Grab an old laptop or a Raspberry Pi, install OPNsense or AdGuard Home, and start segmenting your network. The hands-on experience you'll gain from defending your own network is the most effective way to build real-world security skills.