Skip to content

Instantly share code, notes, and snippets.

@williamzujkowski
Created November 3, 2025 02:58
Show Gist options
  • Select an option

  • Save williamzujkowski/6eaf1ebe4f96aad330fc23fc5b57c671 to your computer and use it in GitHub Desktop.

Select an option

Save williamzujkowski/6eaf1ebe4f96aad330fc23fc5b57c671 to your computer and use it in GitHub Desktop.
Network segmentation firewall rules for AI VLAN using iptables
#!/bin/bash
# Dream Machine Professional firewall rules for AI VLAN
# Network segmentation for AI workloads
# AI VLAN Configuration
AI_VLAN="10.0.50.0/24"
INTERNAL_REPO="10.0.10.5"
# Allow: AI VLAN -> Internal model repository
iptables -A FORWARD -s $AI_VLAN -d $INTERNAL_REPO -j ACCEPT
# Allow: AI VLAN -> Specific whitelisted APIs (OpenAI, Hugging Face)
iptables -A FORWARD -s $AI_VLAN -d api.openai.com -j ACCEPT
iptables -A FORWARD -s $AI_VLAN -d huggingface.co -j ACCEPT
# Block: AI VLAN -> Home network
iptables -A FORWARD -s $AI_VLAN -d 10.0.1.0/24 -j DROP
# Block: AI VLAN -> Management network
iptables -A FORWARD -s $AI_VLAN -d 10.0.0.0/24 -j DROP
# Log: All AI VLAN traffic for monitoring
iptables -A FORWARD -s $AI_VLAN -j LOG --log-prefix "AI-VLAN: "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment