Building a Secure Proxmox Virtualization Host with Ubuntu, Windows, OPNsense, and OpenVPN (with VLANs, Automation & Zero-Trust Firewall)
Building a Secure Proxmox Virtualization Host with Ubuntu, Windows, OPNsense, and OpenVPN (with VLANs, Automation & Zero-Trust Firewall)
What You Will Learn (At a Glance)
By following this guide, you’ll be able to:
-
Install & secure Proxmox VE on Debian 12
-
Create VLANs to separate Management, Servers, Windows PCs, VPN, and DMZ
-
Deploy Ubuntu and Windows VMs efficiently using automation and templates
-
Set up OPNsense firewall with zero-trust, deny-by-default rules
-
Provide secure remote access via OpenVPN
-
Integrate Authentik + Active Directory for identity and MFA
-
Enforce network segmentation and prevent lateral movement
-
Backup, monitor, and maintain a fully secure virtual environment
Virtualization is the backbone of modern infrastructure, and Proxmox VE is one of the most powerful open-source platforms available today. In this guide, we’ll walk you step-by-step through building a secure Proxmox host using a stable Linux foundation, automating VM creation, enforcing zero-trust firewall rules, and integrating Active Directory + Authentik MFA.
By the end, your environment will host:
1 Ubuntu Server VM
9 Windows VMs
1 OPNsense firewall
1 OpenVPN gateway for remote access
This setup is suitable for homelabs, test environments, or small businesses seeking enterprise-grade capabilities without enterprise licensing costs.
Why Proxmox and Which Linux Is “Best”?
Proxmox VE is built on Debian, which is rock-solid, secure, and actively maintained. For long-term support and stability, Debian 12 (Bookworm) is the recommended base.
Benefits of Debian 12:
Long security support window
Minimal attack surface
Rock-solid KVM + ZFS support
Actively maintained by Proxmox
Best practice: Install Proxmox using the official ISO, which already includes a hardened Debian base.
Hardware Recommendations (Baseline)
| Component | Recommendation |
|---|---|
| CPU | 8–16 cores (Intel VT-x / AMD-V enabled) |
| RAM | 64 GB minimum (Windows VMs consume memory fast) |
| Storage | NVMe SSDs (ZFS mirror preferred) |
| NICs | 2 NICs minimum (WAN + LAN separation) |
Step 1: Install Proxmox VE
Download the latest ISO: Proxmox VE Downloads
During installation:
Filesystem: ZFS (RAID1 if possible)
Hostname:
pve01.yourdomain.localManagement IP: Static
Root password: Strong (SSH keys only later)
After installation, you can access the web GUI:
Step 2: Initial Host Hardening
Update the system:
Disable the enterprise repo if unlicensed:
Enable Proxmox firewall globally:
Secure SSH access:
Ensure:
Restart SSH:
🔐 Use SSH keys only for management access.
Step 3: Network Design (Critical for Security)
VLAN Plan
| VLAN | Purpose | Subnet |
|---|---|---|
| 10 | Management | 192.168.10.0/24 |
| 20 | Servers (Ubuntu) | 192.168.20.0/24 |
| 30 | Windows Workstations | 192.168.30.0/24 |
| 40 | VPN Clients | 192.168.40.0/24 |
| 99 | DMZ / Services | 192.168.99.0/24 |
Proxmox VLAN-Aware Bridge Configuration
Edit /etc/network/interfaces:
Reload networking:
✅ Proxmox is now VLAN-capable
❌ No IPs should be assigned to the host for VLANs (routing is handled by OPNsense).
Step 4: Create OPNsense Firewall VM
VM Specs:
CPU: 2 cores
RAM: 4 GB
NICs:
NIC1 → vmbr2 (WAN)
NIC2 → vmbr1 (LAN)
Upload ISO:
Create VM (example VMID 100):
Attach ISO and disk via GUI, then install normally.
🔥 OPNsense becomes your default gateway for all internal traffic.
OPNsense VLAN Configuration
Parent Interface: LAN (vtnet1)
Add VLANs 10, 20, 30, 40, 99
Assign interfaces and configure optional DHCP
Firewall rules: default deny, allow only as required
🔥 Do not allow lateral movement by default
Step 5: Hardening OPNsense Firewall Rules (Zero-Trust by Design)
At this stage, OPNsense is more than a router — it enforces trust boundaries. The principle is simple:
Nothing talks unless you explicitly allow it.
Core Security Principles
No lateral movement by default
Explicit allow rules only
Inter-VLAN isolation
Full logging for sensitive paths
Minimal exposed services
VLAN Reference
| VLAN | Purpose | Interface |
|---|---|---|
| 10 | Management | VLAN10_MGMT |
| 20 | Linux Servers | VLAN20_SERVERS |
| 30 | Windows | VLAN30_WINDOWS |
| 40 | VPN Clients | VLAN40_VPN |
| 99 | DMZ | VLAN99_DMZ |
Step 5a: Global Firewall Defaults
Disable Anti-Lockout (after confirming SSH/GUI access from MGMT VLAN)
Firewall → Settings → Advanced → Disable Anti-lockoutEnsure explicit allow rules exist for admin access
Step 5b: Management VLAN (VLAN 10)
Goal: Admins only. Minimal internet access.
Allow Rules (Top → Bottom):
Admin Access to Firewall
Source: VLAN10_MGMT
Destination: This Firewall
Ports: 443, 22
DNS
Port: 53
Updates
Ports: 80, 443
Explicit Block (Optional)
Source: VLAN10_MGMT
Destination: any
Log: Enabled
Prevents accidental pivoting from admin machines.
Step 5c: Server VLAN (VLAN 20 – Ubuntu)
Allow internet for updates (80, 443)
Allow DNS to firewall
Allow SSH only from Management VLAN
Block connections to Windows VLAN
Log blocked traffic
Step 5d: Windows VLAN (VLAN 30)
Allow minimal internet (80, 443)
DNS to firewall
RDP only from Management VLAN
Block Windows → Servers
Log blocked traffic
Step 5e: VPN VLAN (VLAN 40)
VPN → Servers (ports 22, 443)
VPN → Windows (optional, 3389)
Block VPN → Management
Log blocked traffic
Step 5f: DMZ VLAN (VLAN 99)
Allow DMZ → Internet (80, 443)
Block DMZ → Internal LAN
Log blocked traffic
Step 5g: WAN Hardening
No “allow any” rules
No admin access from WAN
Disable ping (optional)
Only allow required port forwards (HTTPS to DMZ)
Step 5h: Logging & Optional Packages
Enable logging on all block rules, VPN, and DMZ
Optional: Zenarmor (Sensei) for Layer 7 visibility, Suricata IDS/IPS (inline)
Step 6: OpenVPN Gateway VM
Either integrated into OPNsense (recommended)
Or separate Ubuntu VM
Route VPN clients → OPNsense → internal networks.
MFA enforced via Authentik later.
Step 7: Ubuntu Server VM
Install Ubuntu Server LTS (22.04/24.04).
Post-install hardening:
Automate Ubuntu VMs (Cloud-Init)
Download Cloud-Init image:
Create template VM:
Deploy VMs:
Bulk deployment:
Step 8: Windows Virtual Machines (9 Total)
Recommended Specs per VM:
CPU: 2 cores
RAM: 4–8 GB
Disk: 60–100 GB
Create base template:
Fully patch Windows
Install VirtIO drivers
Apply security baseline
Run Sysprep:
Convert to template:
Clone for multiple VMs:
Step 9: VLAN-Aware Security Model
All traffic controlled via OPNsense:
| Rule | Action |
|---|---|
| Windows → Ubuntu | Deny |
| Ubuntu → Windows | Allow (specific ports) |
| VPN → Servers | Allow |
| DMZ → LAN | Deny |
| Management VLAN | Admin-only |
Step 10: Backup & Security Best Practices
Enable Proxmox Backup:
Enable 2FA for Proxmox UI (Datacenter → Permissions → TFA)
Regular updates:
Step 11: Active Directory Integration
Deploy Windows Server VM in VLAN 20
Promote to Domain Controller
Domain:
corp.localCreate service account:
svc-authentikCreate groups: VPN-Users, Proxmox-Admins, BreakGlass-Admins
Step 12: Authentik Setup (Identity + MFA)
Ubuntu VM Specs:
CPU: 2 cores
RAM: 4 GB
Disk: 40 GB
Install Docker & Compose:
Deploy Authentik:
Create .env file with strong secrets.
Step 13: Connect Authentik to Active Directory
LDAP Source → Bind to AD
Sync users & groups
Authentik mirrors AD automatically
Step 14: Enable MFA in Authentik
TOTP & WebAuthn devices
Create MFA policy: Require MFA, re-auth every 12 hours
Authentication flow: Identification → Password → MFA
Step 15: Create Policies for Services
VPN MFA Policy:
Break-Glass Policy:
Attach policies to MFA stage.
Step 16: Integrate Authentik with Services
OpenVPN / OPNsense: Authentik via OIDC, enforce MFA
Proxmox: LDAP via Authentik, MFA before login
Windows VMs: Native AD login, MFA enforced
Step 17: Testing & Final Lockdown
Authentik login & MFA enrollment
VPN connection
Proxmox login
Windows access
Disable local admin accounts
Enable logging everywhere
Final Architecture Overview
Closing Thoughts
With this setup, you now have:
Enterprise-grade virtualization
Rapid VM provisioning
Repeatable builds
Firewall-enforced trust boundaries
Network segmentation and VLAN isolation
Centralized identity with MFA
Your lab or small business environment is now secure, automated, zero-trust, and fully integrated, ready for Windows, Linux, VPN, and OPNsense firewalled services.
Closing Thoughts
With this setup, you now have:
-
Enterprise-grade virtualization
-
Rapid VM provisioning
-
Repeatable builds
-
Firewall-enforced trust boundaries
-
Network segmentation and VLAN isolation
-
Centralized identity with MFA
Your lab or small business environment is now secure, automated, zero-trust, and fully integrated, ready for Windows, Linux, VPN, and OPNsense firewalled services.
Here is a little add-on for you to try:
Step 1: Separate Workstation VLAN
Create a new VLAN specifically for workstations that will only access servers via VPN:
| VLAN | Purpose | Subnet |
|---|---|---|
| 50 | Remote Workstations | 192.168.50.0/24 |
-
Update Proxmox VLAN-aware bridge (
vmbr1) to include VLAN 50. -
Tag workstation NICs with VLAN 50.
Example Proxmox VM NIC for a workstation:
Step 2: Adjust OPNsense Firewall Rules
Workstation VLAN (VLAN 50)
-
Allow only VPN access to Server VLAN (VLAN 20)
-
Source: VLAN50
-
Destination: VLAN20
-
Ports: 22, 443, or whatever your services need
-
-
Block all other LAN traffic
-
Destination: VLAN10 (Management), VLAN30 (Windows LAN), VLAN99 (DMZ)
-
🔐 This ensures that the workstations cannot reach servers directly unless connected via VPN.
VPN VLAN (VLAN 40)
-
Ensure the VPN gateway maps VPN clients into the Server VLAN (VLAN20)
-
Authentik MFA enforcement applies here
Step 3: OpenVPN Configuration
-
Assign VPN clients an IP range separate from VLAN50
-
e.g., 10.10.50.0/24
-
-
Configure routing so VPN clients can access VLAN20 (Servers) only
-
Block access to Management VLAN and Windows LAN VLAN
Example server-side OpenVPN route:
-
Authentik integration ensures users must authenticate via MFA before traffic is allowed.
Step 4: Windows Workstation Deployment
-
Assign each VM NIC to VLAN50
-
Configure the OpenVPN client on each workstation to connect automatically on boot
-
Ensure no direct routes to Server VLAN exist outside of VPN
Step 5: Testing the Isolation
-
Attempt to ping a server directly from a workstation VM → Should fail
-
Connect via OpenVPN → Access to servers allowed based on policy
-
Confirm MFA prompt occurs before access
-
Attempt lateral movement to other VLANs → Should be blocked
Result:
-
Workstations are physically or logically isolated
-
All access to servers goes through VPN + MFA
-
Full zero-trust enforced across the lab environment


Comments
Post a Comment
Got something to say? Drop a comment below — let’s chat!