Blueprint / hardened-infrastructure

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.

Status
Stable
Difficulty
Expert
Time to Deploy
3 Hours
Security Level
Critical

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.

InterfaceVLAN TagSubnetPurpose
igb0.505010.50.0.0/24AI Compute Nodes
igb0.101010.10.0.0/24Admin / Management
igb0.11192.168.1.0/24General Office

Firewall Rules (OPNsense)

Navigate to Firewall > Rules > AI_Sovereign (VLAN 50):

ActionProtocolSourcePortDestinationPortDescription
PASSTCPAdmin LAN*AI Node IP11434Ollama API ingress
PASSTCPAdmin LAN*AI Node IP3000Open WebUI ingress
PASSTCPAI Node*Local DNS53DNS 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/tags from the Admin LAN to verify the ingress rule works.

Failure Modes

  • DNS breaks inside container: Add an explicit PASS TCP AI_Node -> LocalDNS:53 rule 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 Publication

OpsNexusAI 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.