Skip to content

Nuface Blog

้šจๆ„้šจๆ‰‹่จ˜ Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
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

  • Postfix + Letโ€™s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Letโ€™s Encrypt + BIND9 + DANE TLSA ๆŒ‡็ด‹่‡ชๅ‹•ๆ›ดๆ–ฐๅฎŒๆ•ดๆ•™ๅญธ
  • Deploying DANE in Postfix
  • ๅฆ‚ไฝ•ๅœจ Postfix ไธญ้ƒจ็ฝฒ DANE
  • DANE: DNSSEC-Based TLS Protection

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

  • December 2025
  • November 2025
  • October 2025

Categories

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