Securing a Private AI Server with OPNsense VLANs
Step-by-step blueprint for isolating LLM inference workloads using OPNsense VLAN micro-segmentation and strict egress blocking.
Threat Model
The primary risk in a local LLM deployment is model exfiltration via outbound network calls. Docker containers run as root by default and have outbound network access unless explicitly blocked. A compromised model or malicious prompt could initiate callbacks to external infrastructure.
VLAN Design
Create a dedicated VLAN tagged as AI_Sovereign with subnet 10.50.0.0/24 in OPNsense.
| Interface | VLAN Tag | Subnet | Purpose |
|---|---|---|---|
| igb0.50 | 50 | 10.50.0.0/24 | AI Compute Nodes |
| igb0.10 | 10 | 10.10.0.0/24 | Admin / Management |
| igb0.1 | 1 | 192.168.1.0/24 | General Office |
Firewall Rules (OPNsense)
Navigate to Firewall > Rules > AI_Sovereign (VLAN 50):
| Action | Protocol | Source | Port | Destination | Port | Description |
|---|---|---|---|---|---|---|
| PASS | TCP | Admin LAN | * | AI Node IP | 11434 | Ollama API ingress |
| PASS | TCP | Admin LAN | * | AI Node IP | 3000 | Open WebUI ingress |
| PASS | TCP | AI Node | * | Local DNS | 53 | DNS resolution |
| BLOCK | * | AI Node | * | * | * | Default deny all outbound |
Key Security Notes
- Set the default deny rule before any allow rules to enforce deny-by-default.
- The Ollama API (
0.0.0.0:11434) is unauthenticated by default. Never expose it without a reverse proxy with auth. - Run
curl http://10.50.0.x:11434/api/tagsfrom the Admin LAN to verify the ingress rule works.
Failure Modes
- DNS breaks inside container: Add an explicit
PASS TCP AI_Node -> LocalDNS:53rule before the final block. - Docker bridge bypasses VLAN rules: Confirm the Docker host NIC is on the correct VLAN trunk port in your switch config.
OpsNexusAI Engineering
Verified Lab PublicationOpsNexusAI is a technical laboratory dedicated to sovereign AI infrastructure. Every implementation guide and architectural blueprint published here is tested on physical hardware and isolated networks. Our team specializes in the deployment of private LLMs, network hardening with OPNsense, and enterprise-grade automation patterns.