
Establishing a secure, isolated SOC Lab environment using OPNsense as the edge gateway.
Published on December 16, 2025 by Kyle S
opnsense homelab security network
3 min READ
Goal: To establish a secure, isolated SOC Lab environment using OPNsense as the edge gateway. The objective is to ensure the Lab network (10.0.0.1/24) has internet access but is completely segmented from the existing Home network (192.168.1.x), preventing any accidental interaction or “bleed-over” from vulnerable/infected lab machines to personal devices.
192.168.1.159 (DHCP from Home Router)10.0.0.1 (Static Gateway for Lab VMs)The Problem: Upon initial installation, OPNsense blocks all access on the WAN port by default (security best practice). However, the management computer was located on the WAN network (192.168.1.x), making it impossible to access the web GUI to configure the LAN interface.
The Solution (Console Override):
pfctl -d
https://192.168.1.159).pfctl -e).The Configuration: Using the OPNsense console Option 2 (Set Interface IP Address), the LAN interface was configured:
10.0.0.1/2410.0.0.100 - 10.0.0.200)Troubleshooting: The Kali Linux VM on the LAN initially failed to connect. This was resolved by forcing a DHCP release/renew (sudo dhclient -r && sudo dhclient -v), confirming connectivity to the gateway.
The Goal: Block Lab (LAN) $\rightarrow$ Home (WAN), but Allow Lab $\rightarrow$ Internet.
Step 1: Creating the Alias To simplify rules, an Alias was created to represent all private network ranges.
RFC1918_Networks192.168.0.0/1610.0.0.0/8172.16.0.0/12Step 2: The Logic Error (DNS Blocking) Initially, a block rule was placed to deny access to RFC1918_Networks.
10.0.0.1) falls within the 10.0.0.0/8 range defined in the Alias. The block rule was preventing the Lab machine from reaching the gateway for DNS resolution (UDP 53). Internet IPs (8.8.8.8) were pingable, but domain names were not.Step 3: The Final Correct Rule Order The firewall rules were re-ordered to ensure the Gateway/DNS is accessible before the block rule applies.
Final LAN Rule Hierarchy (Top to Bottom):
RFC1918_Networks (Alias)The OPNsense router is now successfully routing traffic for the lab. The environment is isolated; the “infected” lab machines can reach the internet to download tools but cannot ping or access the host home network.