Excalibur's Sheath

Designing a Secure & Scalable Homelab Network

Jul 20, 2025 By: Jordan McGilvrayhomelab,network design,opnsense,vlans,selfhosting

Homelab: Mastering the Network: Part 7 of 7

A secure and scalable network is the backbone of any successful homelab. Last week, we explored the essentials of network monitoring, logging, and alerts—the essential tools that help you keep an eye on your network’s health and security. Without a solid foundation, even the best services risk poor performance or security issues.

Many homelabbers start with an organic setup—a default router, a flat LAN, and everything connected. While this works for casual use, scaling up while maintaining security requires intention and structure. The good news is that with a few deliberate design choices, you can keep your network clean, manageable, and ready to grow.

This guide will walk you through the essential practices for creating a manageable and secure homelab network—from physical layout and VLANs to IPv6, password managers, containers, and beyond. Whether you’re just using a single router with a flat network or looking to level up your architecture as your services grow, these concepts apply.

We’ll focus on using OPNsense for network routing and segmentation, but the principles here can be adapted to other setups. Plus, you’ll find a downloadable checklist at the end to help guide your own configuration.

Network Segmentation with OPNsense

Network segmentation helps isolate devices and services, improving both security and performance. Using VLANs in OPNsense, you can define multiple logical networks over a single physical interface—or use multiple NICs for cleaner separation.

For a deeper dive into practical network diagnostics and management commands, see Mastering Network Tools and Essential Linux Commands.

Common VLAN Segments

  • LAN (Trusted): Personal desktops, laptops, and home servers
  • IoT VLAN: Smart plugs, thermostats, TVs—devices that don’t need access to your core systems
  • Guest VLAN: Isolated internet access for guests or untrusted devices
  • Management VLAN: Access to switches, firewalls, and other infrastructure
  • DMZ or Public VLAN: Public-facing services like a blog or VPN endpoint
  • Lab VLAN: Experimental or container workloads that may not be fully trusted

OPNsense Configuration Steps

  1. Create VLAN Interfaces
    Go to Interfaces > Other Types > VLAN. Add VLANs with distinct IDs on your base NIC.

  2. Assign VLANs to Interfaces
    Navigate to Interfaces > Assignments, then assign your VLANs and enable each one.

  3. Set Up DHCP per VLAN
    Services > DHCPv4 > [VLAN] to give out IPs only within that network.

  4. Configure Firewall Rules
    Go to Firewall > Rules > [VLAN] and restrict traffic between VLANs or outbound.

  5. Tag VLANs on Switch Ports
    Ensure your managed switch ports are tagged correctly (trunk vs. access mode).

Example: VLANs on a Dual-NIC OPNsense Box

+---------------------+       +--------------------+
|    OPNsense Box     |       |   Managed Switch   |
|---------------------|       |--------------------|
| NIC1: WAN           |       | Port 1: Trunk (all VLANs) <--- to OPNsense NIC2
| NIC2: LAN Trunk     |<----->| Port 2: Access VLAN 10 (LAN)
|                     |       | Port 3: Access VLAN 20 (IoT)
|                     |       | Port 4: Access VLAN 30 (Guest)
+---------------------+       +--------------------+

Example: Multi-NIC Segmented Homelab

+-------------+        +-------------+
|             |        |             |
|   Internet  +-------->  OPNsense   |
|             |  WAN   |  Firewall   |
+-------------+        |             |
                       |   NIC 1     |--> VLAN 10 (LAN)
                       |   NIC 2     |--> VLAN 20 (SERVERS)
                       |   NIC 3     |--> VLAN 30 (IOT)
                       |   NIC 4     |--> VLAN 40 (GUEST)
                       |             |
                       +-------------+
                                |
                       +-------------------+
                       | Managed Switch    |
                       +-------------------+
                                |
                        +-------+-------+
                        |       |       |
                     Devices in each VLAN

Tip: You don’t have to pick just one. Combine tagged VLANs and separate NICs however it makes sense for your setup. The goal is isolation and control—how you get there is up to your gear and your needs.

IPv4 & IPv6 Addressing and Subnetting

Available IPv4 Private Ranges

Range CIDR Size Usage Example
10.0.0.0/8 Large (16M hosts) Best for large or segmented homelabs  
172.16.0.0/12 Medium (1M hosts) Good for medium-sized home setups  
192.168.0.0/16 Common (65k hosts) Most home routers use this  

Choose a range that won’t conflict with VPNs or cloud services. Many homelabs prefer 10.0.0.0/8 to give each VLAN a separate /24.

IPv6 Brief Primer

IPv6 uses 128-bit addresses, offering an enormous address space. Subnetting typically uses a /64 per VLAN. If your ISP gives you a /56, you can create 256 /64 subnets easily.

IPv6 does not use NAT, so firewall rules are critical to control traffic and prevent unwanted access. Be sure to carefully configure IPv6 firewall rules in OPNsense to secure each VLAN.

Enable IPv6 RA (Router Advertisements) and DHCPv6 for each VLAN in OPNsense if using public IPv6.

Since IPv6 addresses are globally routable, it’s especially important to keep your firmware and software updated and monitor your network for any unexpected traffic.

If remote access or VPN tunnels are part of your setup, implementing secure connectivity is essential. Our guide on Implementing WireGuard VPN on OPNsense provides a detailed walkthrough.

Monitoring, Alerts, and Device Discovery

Monitoring helps you catch issues before they break your services.

Tools to Consider

  • LibreNMS or Zabbix: Full-featured monitoring with SNMP
  • Grafana + Prometheus: Metrics dashboard for containers and hosts
  • Uptime Kuma: Simple uptime checker for self-hosted services
  • Netdata: Easy to deploy, instant visual dashboards
  • OPNsense Reporting: Built-in interface statistics and logs

Monitoring and alerting form a crucial layer of defense. Tools covered in previous guides like Mastering Network Tools complement monitoring solutions to give you a full picture of network health.

Alerts

Use email, webhooks, or Telegram/Matrix integrations for push alerts.

Device Discovery

Run occasional network scans with nmap, arp-scan, or Angry IP Scanner to inventory new devices—especially useful in IoT VLANs.

Naming Conventions for Devices and Hosts

Clarity in naming helps you troubleshoot and document quickly. Strike a balance between meaningful and fun.

Approaches

  • Functional: nas01, printer-livingroom, cam-garage
  • Role + Location: vm-web1-lab, switch-core, ap-2f
  • Fun Themes: Mythology (ares, zeus), Sci-fi (serenity, hal9000), Colors or Fruits

Guidelines

  • Use short, consistent prefixes or suffixes
  • Avoid using IPs or MACs in the name
  • Match reverse DNS to the hostname
  • Document your scheme!

Sample Naming Table

Hostname Role VLAN IP Address Location
nas01 Storage LAN 10.0.10.5 Basement
iot-tv1 IoT Device IoT 10.0.20.15 Living Room
vm-lab1 Dev VM Lab 10.0.50.10 Rack
vpn-gw VPN Server DMZ 10.0.40.1 DMZ

Self-Hosted Password Managers and Secure Sharing

  • Vaultwarden: Bitwarden-compatible, lightweight, great web/mobile UX
  • Passbolt: Browser-based, good for teams
  • KeePassXC: Desktop-first, local database. Syncable via Nextcloud or Syncthing
  • Psono: Less common, strong for advanced features and sharing

Maintaining security is not only about segmentation and firewalls — regular system auditing helps, too. See File Auditing and Security Tools for strategies and software recommendations.

Securely Sharing KeePass Databases

  • Nextcloud + File Locking: Prevents sync conflicts
  • Syncthing (carefully configured): Peer-to-peer syncing, secure over LAN
  • Encrypted Backups: Use GPG or VeraCrypt to protect archives
  • Multi-user Needs: Vaultwarden or Passbolt preferred for real-time shared access

Containers and Docker in the Homelab

Containers are lightweight and make service management more flexible.

When to Use Docker

  • Running multiple small services with minimal overhead
  • Isolating services from the host OS
  • Automating deployments (e.g., via Portainer or Ansible)

Tips

  • Run Docker containers on a separate VLAN or lab network
  • Monitor exposed ports and bind only to localhost when possible
  • Consider tools like Docker Compose, Podman, or K3s for orchestration

As you design your homelab’s network, think of it not as a set of devices—but as a system. Each service, switch, and subnet is a piece of that system, and how they relate to one another determines your experience as an administrator.

Security, scalability, and clarity are not in conflict. Segmentation with OPNsense, thoughtful IP planning, and good naming conventions help you build a setup that grows with you rather than fights you. You don’t need to implement every best practice all at once—just move forward with intention.

Whether you’re hosting a password manager, running monitoring tools, or experimenting with containers, everything becomes easier when the network itself is solid. The extra effort you put into structuring your environment now pays back in reliability later.

Your homelab is a proving ground—for ideas, tools, and skills. With a secure and scalable network foundation, you’re free to build, break, and rebuild with confidence.

Have a homelab layout you’re proud of? Share it or ask questions in the comments below—I’d love to hear what you’re building.

Homelab Network Design Checklist

Here’s a handy checklist to guide your homelab network design progress.

Copy and adapt this to track your setup progress:

Network Planning

  • Select private IPv4 range (e.g., 10.0.0.0/8)
  • Plan VLAN segments: LAN, IoT, Guest, Management, Lab, etc.
  • Assign subnets per VLAN

OPNsense Setup

  • Create VLAN interfaces
  • Assign VLANs to interfaces
  • Set DHCP per VLAN
  • Configure firewall rules
  • Enable IPv6 RA/DHCPv6 per VLAN if needed

Physical Layout

  • Trunk ports set correctly on managed switches
  • Access ports configured per VLAN

Monitoring

  • Deploy monitoring tools (e.g., Netdata, Grafana)
  • Set up alerts
  • Schedule network scans

Naming and Docs

  • Define naming convention
  • Create inventory of devices
  • Document VLANs and firewall rules

Password Management

  • Deploy a password manager (Vaultwarden, KeePassXC, etc.)
  • Set up secure sharing or syncing

Containers

  • Deploy container host in lab VLAN
  • Lock down exposed ports
  • Use Compose or Portainer for management

More from the "Homelab: Mastering the Network" Series: