/homelab-vlan-segmentation
Segmenting home networks into VLANs for IoT, guest, trusted, and server traffic using UniFi, pfSense/OPNsense, and MikroTik — including switch trunk config, firewall rules, and wireless SSID mapping.
$ npx -y skills add affaan-m/ECC --skill homelab-vlan-segmentation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/homelab-vlan-segmentation
Context preview
The summary Claude sees to decide when to auto-load this skill.
Segmenting home networks into VLANs for IoT, guest, trusted, and server traffic using UniFi, pfSense/OPNsense, and MikroTik — including switch trunk config, firewall rules, and wireless SSID mapping.
SKILL.md
homelab-vlan-segmentation.SKILL.mdname: homelab-vlan-segmentation
description: Segmenting home networks into VLANs for IoT, guest, trusted, and server traffic using UniFi, pfSense/OPNsense, and MikroTik — including switch trunk config, firewall rules, and wireless SSID mapping.
metadata:
origin: community
Homelab VLAN Segmentation
How to split a home network into isolated VLANs so IoT devices, guests, and your main PCs cannot talk to each other. The most impactful security upgrade for a home network.
All firewall rules shown here add isolation between segments — they do not remove existing protections. Apply changes in a maintenance window and verify connectivity between segments after each step before moving on.
When to Use
- Setting up VLANs on a home network for the first time
- Isolating IoT devices (smart bulbs, cameras, TVs) from trusted devices
- Creating a guest Wi-Fi network that cannot reach home devices
- Explaining how VLANs work to someone unfamiliar with the concept
- Configuring trunk ports, access ports, and SSID-to-VLAN mapping
- Troubleshooting inter-VLAN routing or firewall rule issues on pfSense/OPNsense/UniFi
How It Works
Without VLANs — flat network:
All devices on 192.168.1.0/24
Smart TV (potential malware) → can reach your NAS, PCs, everything
With VLANs:
VLAN 10 — Trusted 192.168.10.0/24 (PCs, phones, laptops)
VLAN 20 — IoT 192.168.20.0/24 (smart TV, bulbs, cameras)
VLAN 30 — Servers 192.168.30.0/24 (NAS, Pi, VMs)
VLAN 40 — Guest 192.168.40.0/24 (visitor Wi-Fi)
VLAN 99 — Management 192.168.99.0/24 (switch/AP web UIs)
Smart TV → blocked from reaching 192.168.10.0/24 and 192.168.30.0/24
Guests → internet only, cannot see any home devices
VLAN Design Template
VLAN Name Subnet Gateway Purpose
10 trusted 192.168.10.0/24 192.168.10.1 PCs, phones, laptops
20 iot 192.168.20.0/24 192.168.20.1 Smart home devices
30 servers 192.168.30.0/24 192.168.30.1 NAS, Pi, self-hosted
40 guest 192.168.40.0/24 192.168.40.1 Visitor Wi-Fi
99 management 192.168.99.0/24 192.168.99.1 Network gear web UIs
Examples
**Typical homelab with UniFi AP and managed switch:**
Scenario: 3-bedroom house, UniFi Dream Machine + UniFi 8-port switch + 2 APs
VLAN 10 — Trusted 192.168.10.0/24 MacBook, iPhones, iPad
VLAN 20 — IoT 192.168.20.0/24 Nest thermostat, Philips Hue, Ring doorbell, smart TVs
VLAN 30 — Servers 192.168.30.0/24 Synology NAS (192.168.30.10), Pi-hole (192.168.30.2)
VLAN 40 — Guest 192.168.40.0/24 Visitor Wi-Fi — internet only
SSID → VLAN mapping:
"Home" → VLAN 10 (WPA2, strong password, trusted devices only)
"IoT" → VLAN 20 (WPA2, separate password, printed on router for setup)
"Guest" → VLAN 40 (WPA2, simple password you can share freely)
Switch port behavior:
Port 1 → trunk to router (tagged VLANs 10,20,30,40,99)
Port 2 → trunk to APs (tagged VLANs 10,20,40; AP handles per-SSID tagging)
Port 3 → access VLAN 30 (NAS — untagged, no VLAN awareness needed)
Port 4 → access VLAN 30 (Pi-hole — untagged)
Port 5–8 → access VLAN 10 (wired workstations)
Firewall rules applied (all rules add isolation, none remove existing protections):
IoT → Trusted: BLOCK
IoT → Servers: BLOCK except 192.168.30.2:53 (Pi-hole DNS allowed)
IoT → Internet: ALLOW
Guest → Local networks: BLOCK
Guest → Internet: ALLOW
Trusted → everywhere: ALLOW
UniFi Configuration
Create Networks in UniFi Controller
Settings → Networks → Create New Network
For each VLAN:
Name: IoT
Purpose: Corporate (gives DHCP + routing)
VLAN ID: 20
Network: 192.168.20.0/24
Gateway IP: 192.168.20.1
DHCP: Enable
DHCP Range: 192.168.20.100 – 192.168.20.254
Map SSIDs to VLANs (UniFi)
Settings → WiFi → Create New WiFi
Name: IoT-Network
Password: <separate password>
Network: IoT ← select your VLAN here
# All devices connecting to this SSID land in VLAN 20
Name: Guest
Password: <guest password>
Network: Guest
Guest Policy: Enable ← isolates guests from each other too
UniFi Firewall Rules (Traffic Rules)
Settings → Traffic & Security → Traffic Rules
# Block IoT from reaching Trusted VLAN
Action: Block
Category: Local Network
Source: IoT (192.168.20.0/24)
Destination: Trusted (192.168.10.0/24)
# Allow IoT to reach internet only
Action: Allow
Source: IoT
Destination: Internet
# Block Guest from all local networks
Action: Block
Source: Guest
Destination: Local Networks
pfSense / OPNsense Configuration
Create VLANs
Interfaces → Assignments → VLANs → Add
Parent Interface: em1 (your LAN NIC)
VLAN Tag: 20
Description: IoT
# Repeat for each VLAN, then assign each VLAN to an interface:
Interfaces → Assignments → Add
Select the VLAN you created → click Add
Enable the interface, set IP to gateway address (192.168.20.1/24)
DHCP for Each VLAN
Services → DHCP Server → Select your VLAN interface
Enable DHCP
Range: 192.168.20.100 to 192.168.20.254
DNS Servers: 192.168.30.2 ← Pi-hole IP if you have one
Firewall Rules (pfSense/OPNsense)
# Rules are processed top-to-bottom, first match wins.
# On the IoT interface (VLAN 20):
Rule 1: Allow IoT → Pi-hole DNS ← MUST come before the RFC1918 block rule
Protocol: UDP/TCP
Source: IoT net
Destination: 192.168.30.2 port 53
Action: Allow
Rule 2: Block IoT → RFC1918 (all private IP ranges)
Protocol: any
Source: IoT net
Destination: RFC1918 (192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12)
Action: Block
Rule 3: Allow IoT → internet
Protocol: any
Source: IoT net
Destination: any
Action: Allow
# On the Trusted interface (VLAN 10):
Allow all (trusted devices can reach everything)
Source: Trusted net
Destination: any
Action: Allow
# Additional exceptions for IoT deviceRead more
name: homelab-vlan-segmentation description: Segmenting home networks into VLANs for IoT, guest, trusted, and server traffic using UniFi, pfSense/OPNsense, and MikroTik — including switch trunk config, firewall rules, and wireless SSID mapping. metadata: origin: community
Homelab VLAN Segmentation
How to split a home network into isolated VLANs so IoT devices, guests, and your main PCs cannot talk to each other. The most impactful security upgrade for a home network.
All firewall rules shown here add isolation between segments — they do not remove existing protections. Apply changes in a maintenance window and verify connectivity between segments after each step before moving on.
When to Use
- Setting up VLANs on a home network for the first time
- Isolating IoT devices (smart bulbs, cameras, TVs) from trusted devices
- Creating a guest Wi-Fi network that cannot reach home devices
- Explaining how VLANs work to someone unfamiliar with the concept
- Configuring trunk ports, access ports, and SSID-to-VLAN mapping
- Troubleshooting inter-VLAN routing or firewall rule issues on pfSense/OPNsense/UniFi
How It Works
Without VLANs — flat network: All devices on 192.168.1.0/24 Smart TV (potential malware) → can reach your NAS, PCs, everything With VLANs: VLAN 10 — Trusted 192.168.10.0/24 (PCs, phones, laptops) VLAN 20 — IoT 192.168.20.0/24 (smart TV, bulbs, cameras) VLAN 30 — Servers 192.168.30.0/24 (NAS, Pi, VMs) VLAN 40 — Guest 192.168.40.0/24 (visitor Wi-Fi) VLAN 99 — Management 192.168.99.0/24 (switch/AP web UIs) Smart TV → blocked from reaching 192.168.10.0/24 and 192.168.30.0/24 Guests → internet only, cannot see any home devices
VLAN Design Template
VLAN Name Subnet Gateway Purpose 10 trusted 192.168.10.0/24 192.168.10.1 PCs, phones, laptops 20 iot 192.168.20.0/24 192.168.20.1 Smart home devices 30 servers 192.168.30.0/24 192.168.30.1 NAS, Pi, self-hosted 40 guest 192.168.40.0/24 192.168.40.1 Visitor Wi-Fi 99 management 192.168.99.0/24 192.168.99.1 Network gear web UIs
Examples
**Typical homelab with UniFi AP and managed switch:**
Scenario: 3-bedroom house, UniFi Dream Machine + UniFi 8-port switch + 2 APs VLAN 10 — Trusted 192.168.10.0/24 MacBook, iPhones, iPad VLAN 20 — IoT 192.168.20.0/24 Nest thermostat, Philips Hue, Ring doorbell, smart TVs VLAN 30 — Servers 192.168.30.0/24 Synology NAS (192.168.30.10), Pi-hole (192.168.30.2) VLAN 40 — Guest 192.168.40.0/24 Visitor Wi-Fi — internet only SSID → VLAN mapping: "Home" → VLAN 10 (WPA2, strong password, trusted devices only) "IoT" → VLAN 20 (WPA2, separate password, printed on router for setup) "Guest" → VLAN 40 (WPA2, simple password you can share freely) Switch port behavior: Port 1 → trunk to router (tagged VLANs 10,20,30,40,99) Port 2 → trunk to APs (tagged VLANs 10,20,40; AP handles per-SSID tagging) Port 3 → access VLAN 30 (NAS — untagged, no VLAN awareness needed) Port 4 → access VLAN 30 (Pi-hole — untagged) Port 5–8 → access VLAN 10 (wired workstations) Firewall rules applied (all rules add isolation, none remove existing protections): IoT → Trusted: BLOCK IoT → Servers: BLOCK except 192.168.30.2:53 (Pi-hole DNS allowed) IoT → Internet: ALLOW Guest → Local networks: BLOCK Guest → Internet: ALLOW Trusted → everywhere: ALLOW
UniFi Configuration
Create Networks in UniFi Controller
Settings → Networks → Create New Network For each VLAN: Name: IoT Purpose: Corporate (gives DHCP + routing) VLAN ID: 20 Network: 192.168.20.0/24 Gateway IP: 192.168.20.1 DHCP: Enable DHCP Range: 192.168.20.100 – 192.168.20.254
Map SSIDs to VLANs (UniFi)
Settings → WiFi → Create New WiFi Name: IoT-Network Password: <separate password> Network: IoT ← select your VLAN here # All devices connecting to this SSID land in VLAN 20 Name: Guest Password: <guest password> Network: Guest Guest Policy: Enable ← isolates guests from each other too
UniFi Firewall Rules (Traffic Rules)
Settings → Traffic & Security → Traffic Rules # Block IoT from reaching Trusted VLAN Action: Block Category: Local Network Source: IoT (192.168.20.0/24) Destination: Trusted (192.168.10.0/24) # Allow IoT to reach internet only Action: Allow Source: IoT Destination: Internet # Block Guest from all local networks Action: Block Source: Guest Destination: Local Networks
pfSense / OPNsense Configuration
Create VLANs
Interfaces → Assignments → VLANs → Add Parent Interface: em1 (your LAN NIC) VLAN Tag: 20 Description: IoT # Repeat for each VLAN, then assign each VLAN to an interface: Interfaces → Assignments → Add Select the VLAN you created → click Add Enable the interface, set IP to gateway address (192.168.20.1/24)
DHCP for Each VLAN
Services → DHCP Server → Select your VLAN interface Enable DHCP Range: 192.168.20.100 to 192.168.20.254 DNS Servers: 192.168.30.2 ← Pi-hole IP if you have one
Firewall Rules (pfSense/OPNsense)
# Rules are processed top-to-bottom, first match wins.
# On the IoT interface (VLAN 20):
Rule 1: Allow IoT → Pi-hole DNS ← MUST come before the RFC1918 block rule
Protocol: UDP/TCP
Source: IoT net
Destination: 192.168.30.2 port 53
Action: Allow
Rule 2: Block IoT → RFC1918 (all private IP ranges)
Protocol: any
Source: IoT net
Destination: RFC1918 (192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12)
Action: Block
Rule 3: Allow IoT → internet
Protocol: any
Source: IoT net
Destination: any
Action: Allow
# On the Trusted interface (VLAN 10):
Allow all (trusted devices can reach everything)
Source: Trusted net
Destination: any
Action: Allow
# Additional exceptions for IoT deviceYour agent can write code, but ECC gives it a coordinated engineering system and toolbox: it plans before it builds, verifies changes with tests, reviews its own work from a fresh context, remembers what matters, and turns repeated wins into reusable skills
Repo: affaan-m/ECC
Other skills on ecc.
- /everything-claude-code
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Open skill - /accessibility
Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA
Open skill - /agent-architecture-audit
Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for
Open skill - /agent-eval
Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics
Open skill - /agent-harness-construction
Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.
Open skill - /agent-introspection-debugging
Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.
Open skill

