Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login/Logout
Menu

Complete Guide: Installing and Configuring OPNsense Firewall on Proxmox VE

Posted on 2025-11-062025-11-06 by Rico

Audience: IT administrators, network engineers, and virtualization enthusiasts
Environment: Proxmox VE + OPNsense (FreeBSD-based firewall)


📘 1. Why Choose OPNsense?

OPNsense is a FreeBSD-based open-source firewall maintained by Deciso.
It offers enterprise-grade features — IDS/IPS, traffic shaping, VPN, proxy, and QoS — in a modern web interface with active updates.

When running Proxmox VE, OPNsense is one of the best virtual firewall solutions for isolating, routing, and protecting your virtual networks.


⚙️ 2. Installing OPNsense on Proxmox VE

🧩 System Requirements

ComponentMinimumRecommended
CPU2 Cores2–4 Cores (VT-x / AMD-V enabled)
RAM2 GB4–8 GB (more for IDS/IPS)
Disk10 GB20 GB+
NICs2One for WAN, one for LAN (add DMZ if needed)

🖧 Network Bridge Layout

PurposeBridgeDescription
WANvmbr0External Internet connection
LANvmbr1Internal virtual network

💿 Upload the OPNsense ISO

Download the latest ISO from
👉 https://opnsense.org/download/

Then upload it to your Proxmox node:

scp OPNsense-*.iso root@<pve_ip>:/var/lib/vz/template/iso/

⚙️ Create the VM via CLI

qm create 101 \
  --name opnsense \
  --memory 4096 \
  --cores 2 \
  --cpu host \
  --machine q35 \
  --bios ovmf \
  --ostype l26 \
  --scsihw virtio-scsi-pci \
  --bootdisk scsi0 \
  --boot order=scsi0;ide2;net0 \
  --agent 1 \
  --rng0 source=/dev/urandom

Add disk and network interfaces:

qm set 101 --scsi0 local-lvm:20
qm set 101 --ide2 local:iso/OPNsense-25.1.iso,media=cdrom
qm set 101 --net0 virtio,bridge=vmbr0     # WAN
qm set 101 --net1 virtio,bridge=vmbr1     # LAN
qm set 101 --vga serial0 --serial0 socket

Start the VM:

qm start 101

💻 Install OPNsense

At the console:

Login: installer
Password: opnsense

Select Install, choose Auto (UFS) for partitioning, and set a root password.
After reboot:

LAN IP: 192.168.1.1/24
User: root
Pass: opnsense

🌐 3. Accessing the Web GUI

Open your browser and go to:

https://192.168.1.1

Log in with default credentials.
Follow the setup wizard:

  • Hostname, DNS, NTP
  • WAN configuration (DHCP / PPPoE / Static)
  • LAN IP setup

🧩 4. Configure WAN Gateway (Static IP)

If your WAN uses a static IP:

System → Routing → Gateways → +Add

Example:

Interface: WAN
Gateway IP: 203.66.123.1
Default Gateway: ✅

🧠 5. If the Web GUI Fails to Start

At the console:

service configd start
service nginx start

Or from the text menu:

12) Restore the web GUI configuration

🔐 6. Setting Up OpenVPN

🪪 Step 1 — Create a Certificate Authority (CA)

System → Trust → Authorities → +Add
Choose “Create an internal Certificate Authority”


🧾 Step 2 — Create a Server Certificate

System → Trust → Certificates → +Add

  • Certificate authority: VPN_CA
  • Type: Server Certificate

🧱 Step 3 — Create an OpenVPN Server

VPN → OpenVPN → Servers → +Add

Recommended settings:

Server Mode: Remote Access (SSL/TLS + User Auth)
Protocol: UDP
Device Mode: tun
Interface: WAN
Tunnel Network: 10.8.0.0/24
Local Network: 192.168.1.0/24
Redirect Gateway: ✅

👤 Step 4 — Create VPN Users

System → Access → Users → +Add
Enable “Create Certificate” for each user.


📦 Step 5 — Export the Client Configuration

VPN → OpenVPN → Client Export → Select user → Download .ovpn file


🧰 7. Allow VPN Clients to Access Multiple Internal Networks

If you have multiple LANs:

LAN1: 192.168.1.0/24
LAN2: 192.168.2.0/24

Add both in OpenVPN → Server → Routing → Local Network:

192.168.1.0/24,192.168.2.0/24

Then open Firewall → Rules → OpenVPN:

Action: Pass
Source: 10.8.0.0/24
Destination: any

Clients will automatically get routes to both LANs.


🧠 8. Layer-7 (L7) Application Control

By default, pf (the firewall engine) supports Layer-3/4 filtering only.
To implement L7 (application-level) control, OPNsense uses add-ons:

ModulePurposeL7 Capabilities
Zenarmor (Sensei)Deep packet inspection, app blocking✅ App-based filtering (YouTube, VPNs, etc.)
SuricataIDS/IPS with signature-based DPI✅ Protocol recognition, threat detection
Squid ProxyWeb filtering & caching⚠️ HTTP/HTTPS only

💡 Recommended combo: Zenarmor + Suricata → visibility + protection.


🧩 9. Troubleshooting Quick Reference

ProblemSolution
Web GUI not loadingservice nginx restart
VPN connection failsEnsure UDP/1194 allowed on WAN
Certificate errorRecreate CA and re-issue server cert
VPN client can’t reach LANAdd routes in Local Network and firewall rules
Gateway shows “Offline”Change monitor IP or check upstream connectivity

✅ 10. Conclusion

Deploying OPNsense on Proxmox VE gives you a flexible, secure, and cost-effective virtual firewall solution.
It can handle multi-WAN routing, VLAN segmentation, VPN connectivity, Layer-7 controls, and IDS/IPS — all without license fees.

For small and mid-sized enterprises, it’s a robust, open-source platform that brings security, visibility, and control directly into your virtual infrastructure.

Recent Posts

  • Enterprise AI Platform – AI Security Architecture: Protecting More Than Just the Model
  • 企業 AI 平台-AI Security Architecture:當企業導入 AI,真正需要保護的不只是模型
  • 企業 AI 不只是 LLM:打造高品質 RAG 知識庫的架構與最佳實務
  • Enterprise AI Beyond a Single Agent: Designing an Agent-to-Agent (A2A) Architecture
  • 當企業 AI 不再只有一個 Agent:談 A2A(Agent to Agent)架構

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • July 2026
  • June 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • CUDA
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Lean
  • Linux
  • LLM
  • Mail
  • MIS
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • Python
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • VSM
  • WordPress
© 2026 Nuface Blog | Powered by Superbs Personal Blog theme