Skip to content

OPNsense Firewalls

The OPNsense module manages your firewall infrastructure. It provides real-time monitoring, update management, and configuration backups for all OPNsense installations.

Overview

Host Table

ColumnDescription
CustomerAssigned customer
HostnameName of the firewall
OPNsense VersionInstalled OPNsense version
Agent VersionDATAZONE Agent version
WAN IPPublic WAN address
UptimeTime since last reboot
CPU / RAM / DiskCurrent utilization as progress bars
Last ResponseTimestamp of the last agent heartbeat
Last Config ChangeTimestamp of the last configuration change
GatewaysStatus of configured gateways (color-coded)
WebUIDirect link to the OPNsense web interface

Status Detection

A firewall is considered offline if no heartbeat is received within twice the heartbeat interval. The heartbeat interval is reported by the agent (heartbeat_interval) and the offline detection is calculated as heartbeat_interval x 2. Default: 2x 30s = 60s.

Dynamic Detection

Unlike the other modules (fixed 120s timeout), the OPNsense offline detection dynamically adapts to the actual heartbeat interval of the agent.

Adding a Host

  1. Install the agent on the OPNsense appliance (see Agent Installation)
  2. The agent automatically detects that the system is FreeBSD/OPNsense
  3. The firewall appears in the OPNsense module

Manual (API-based)

  1. Click Add Firewall
  2. Enter the following details:
    • Customer - Assign to a customer
    • Hostname - Display name
    • Host - IP address or FQDN
    • API Key and API Secret - OPNsense API credentials

Setting Up API Access

In the OPNsense web interface under System > Access > Users, you can create API keys. The user requires read permissions for the desired areas.

Detail Modal

Click on a firewall in the table to open the detail modal.

The detail modal contains 9 main tabs at the top. The Overview tab additionally contains 7 sub-tabs for detailed system information.

Main Tabs

TabIconDescription
OverviewMonitorSystem information with sub-tabs (see below)
ChecksClipboardCheckHealth check results and status
JobsListTodoRunning and completed tasks
ShellTerminalRemote terminal to the OPNsense shell
LogFileTextExecution logs for all actions
GroupsTagsManage group membership
UpdatesRefreshCwUpdate history and schedules
AgentCpuAgent status, logs, and management
DeleteTrash2Remove firewall from DATAZONE Control

Tab: Overview

The overview shows the most important metrics (CPU, RAM, Disk, Uptime) as cards at the top. Below are editable fields (Name, Customer, Description) and the sub-tab navigation.

Sub-tab: Hardware

  • CPU model, cores, clock speed
  • RAM size and utilization
  • Disks with size and usage
  • BIOS information

Sub-tab: Interfaces

  • All network interfaces with status (UP/DOWN)
  • Interface name (WAN, LAN, OPT1, etc.)
  • IP addresses (IPv4 and IPv6)
  • Throughput and packet statistics
  • VLAN configurations

Sub-tab: VPN

Overview of all VPN connections, divided into three sections:

OpenVPN:

  • Server and client instances with status (up/down)
  • Connected clients per server
  • Throughput and connection duration
  • Descriptions from the OPNsense config.xml

IPsec:

  • Phase 1 and Phase 2 tunnels
  • Connection status and uptime
  • Remote gateway and local/remote subnets

WireGuard:

  • Peers with status and last handshake
  • Allowed IPs and endpoint information
  • Transferred data per peer

Sub-tab: Routes (since v1.3.0)

  • Complete routing table of the firewall
  • Destination network, gateway, interface
  • Metric and flags
  • Static and dynamic routes

Sub-tab: Certificates (since v1.3.0)

  • ACME certificates (Let's Encrypt) and self-signed SSL certificates
  • Expiration date with color highlighting (red when expiring soon)
  • Certificate details: Common Name, issuer, serial number
  • Cache interval: 6 hours

Sub-tab: Services (since v1.3.0)

Two sections:

OPNsense Services:

  • All configured OPNsense services with status (Running/Stopped)
  • Start and stop services directly from the interface

Nginx Virtual Hosts (if Nginx plugin is installed):

  • Configured Nginx server entries
  • Server name, port, SSL status
  • Upstream configurations
  • Cache interval: 1 hour

Sub-tab: Backups

  • List of configuration backups (config.xml)
  • Backup timestamps
  • Change descriptions
  • Backup size

Unbound DNS Statistics (since v1.3.0)

In the overview, Unbound DNS statistics are displayed as cards (if Unbound is active):

  • Total number of queries
  • Cache hit rate
  • Top queried domains

Tab: Checks

Shows all health checks assigned to this firewall with their current status:

  • OK (green), Warning (yellow), Critical (red), Unknown (gray)
  • Last check result and timestamp
  • Direct link to check configuration

See Health Checks for details.

Tab: Jobs

Overview of all running and completed tasks:

  • Task type (Update, Script, Backup, etc.)
  • Status (Pending, Running, Completed, Failed)
  • Start time and duration
  • Expandable result details

Tab: Shell

Remote terminal to the OPNsense shell directly in the browser. Uses the agent for a secure WebSocket connection.

  • Full interactive terminal
  • FreeBSD shell (csh/sh)
  • Root access

Tab: Log

Chronological execution logs of all actions on this firewall:

  • Timestamp, action, user
  • Result (success/failure)
  • Expandable detail output

Tab: Groups

Manage group membership for this firewall:

  • Current groups with colored badges
  • Add/remove groups

See Groups.

Tab: Updates

  • Update history with date, type, and result
  • Configured update schedules
  • Next scheduled update

Tab: Agent

  • Agent status (Online/Offline) and version
  • View agent configuration
  • View agent logs
  • Restart agent

Tab: Delete

Permanently remove the firewall from DATAZONE Control.

Warning

This action cannot be undone. The agent on the firewall will not be uninstalled.

VPN Management (since v2.2.3)

The OPNsense module provides a centralized management interface for WireGuard VPN directly in DATAZONE Control. Accessible via the VPN tab in the OPNsense module view (next to the host table).

VPN Overview

The VPN table shows all VPN instances across all firewalls. The view aggregates WireGuard, OpenVPN, and IPsec tunnels centrally in one table.

ColumnDescription
CustomerAssigned customer
FirewallName of the firewall
InstanceName of the VPN instance
TypeWG RW (Road Warrior), WG S2S (Site-to-Site), OpenVPN, IPsec
InterfaceWireGuard interface (wg0, wg1, etc.)
PortListening port
Tunnel NetworkIP range of the tunnel
PeersNumber of configured peers
Active PeersNumber of currently connected peers
StatusOnline/Offline

Type Filter: Filter by VPN type (All, WireGuard, OpenVPN, IPsec) with counter badges.

WireGuard Instances

Create New Instance

Click New Instance to create a WireGuard instance on a firewall:

FieldDescription
FirewallTarget firewall (online + API-ready only)
NameName of the WireGuard instance
PortListening port (default: 51820)
Tunnel NetworkIP address and subnet (e.g., 10.10.10.1/24)
DNS for ClientsDNS server for client configurations
Create WAN RuleCreates a UDP firewall rule on the WAN interface
Allow-All on WireGuard InterfaceAllows all traffic through the tunnel

Separate Firewall Rules

The WAN rule (open port) and the Allow-All rule (allow traffic) can be controlled independently. This lets you open the port but manually restrict traffic on the WireGuard interface in OPNsense.

Add Peer

Click on an instance and select Add Peer:

FieldDescription
NameName of the peer (e.g., employee name)
Tunnel IPIP address of the peer in the tunnel network
DNSDNS server for the peer
MTUOnly if different from 1420
Split TunnelRoute only specific networks through the tunnel (LAN subnets auto-detected)

After creation, a client configuration with QR code is displayed that can be imported directly into WireGuard apps.

Private Key

The peer's private key is only displayed once after creation. It cannot be retrieved again. Save the configuration or scan the QR code immediately.

Tunnel Mode

ModeDescription
Full TunnelAll traffic is routed through the VPN tunnel (0.0.0.0/0, ::/0)
Split TunnelOnly specific networks are routed. LAN subnets of the firewall are automatically suggested and can be added with a click.

Instance Detail

Click on a VPN instance to open the detail modal.

WireGuard Instances:

  • Instance name, interface, type badge, and status
  • Associated firewall with direct link
  • Peer table with status, name, allowed IPs, endpoint, last handshake, and traffic (RX/TX)
  • Enable/disable instance
  • View settings (name, interface, port, tunnel network, UUIDs)

IPsec Instances:

  • Phase 2/Child-SA table with local and remote networks
  • Encryption and hash details
  • Remote gateway, IKE version, DH group, lifetime, NAT-T status

Peer Actions

The following actions are available for each WireGuard peer:

ActionDescription
Enable/DisableTemporarily disable the peer without deleting it
Edit Allowed IPsChange the allowed IP ranges for the peer
Configuration/QR CodeShow client configuration (only available immediately after creation)
DeletePermanently remove the peer

Edit Allowed IPs:

  • Chip-based management with add/remove
  • Quick buttons for common ranges: 0.0.0.0/0, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
  • Free-text input for any IP range

Site-to-Site Wizard (since v2.2.3)

The Site-to-Site Wizard automatically creates a WireGuard tunnel between two OPNsense firewalls in three steps:

Step 1: Select Firewalls

  • Choose two online firewalls with API readiness
  • Detected LAN subnets are displayed automatically

Step 2: Configuration

FieldDescription
Tunnel SubnetPoint-to-point network (default: 10.10.99.0/30)
PortWireGuard port on both sides (default: 51821)
Connection ModeEqual, A=Primary, or B=Primary
EndpointsIP or DNS name (depends on connection mode)
Networks A → B / B → AWhich local subnets to route through the tunnel
WAN RuleOpen UDP port on both firewalls
Allow-AllAllow all tunnel traffic

Step 3: Summary and Execution

The wizard automatically performs:

  1. Key generation on both firewalls
  2. Create WireGuard instances with generated keys
  3. Add peers on both sides with PSK (Pre-Shared Key)
  4. Create firewall rules (if enabled)

Connection Mode (since v2.2.10)

ModeDescription
EqualBoth firewalls have static IPs. Either side can initiate the connection. Both get endpoint + keepalive configured.
A = PrimaryFirewall A has a static IP (headquarters). Firewall B (branch office, dynamic IP) connects to A. Only A needs an endpoint. B gets PersistentKeepalive=25.
B = PrimaryReversed: B has a static IP, A connects to B.

Dynamic IP

Use the Primary mode when one site doesn't have a static IP. The secondary site always connects to the primary and keeps the tunnel alive with PersistentKeepalive.

Deleting a Site-to-Site Connection

In the instance detail modal of an S2S connection, the entire Site-to-Site link can be deleted. This automatically:

  • Removes WireGuard instances on both firewalls
  • Deletes peers on both sides
  • Removes associated firewall rules (WAN + Allow-All)

Firewall Rules (since v2.3.0)

The OPNsense module provides centralized management for firewall rules, aliases, categories, and NAT rules directly in DATAZONE Control. Accessible via the Rules tab in the OPNsense module view.

Overview

The Rules overview shows all firewalls with their rule count, broken down by type (Pass, Block, Reject).

Click on a firewall to open the rule editor. It contains 5 tabs:

TabDescription
RulesFilter rules (main rules)
AliasesManage aliases
CategoriesManage categories
NAT SourceOutbound NAT rules (Source NAT)
NAT Port ForwardPort forwarding rules

Commit Workflow

All changes to rules, aliases, and NAT rules are saved locally first. Only by clicking Commit are the changes applied to the firewall. Use Discard to discard uncommitted changes.

Filter Rules (Rules)

The Rules tab shows all firewall rules of the selected firewall with visual status indicators.

Filtering and Searching

  • Action filter: All, Pass, Block, Reject
  • Interface filter: Dropdown with all available interfaces
  • Category filter: Dropdown with all configured categories
  • Free-text search: Searches all visible columns

Rule Display

Each rule shows the following information:

FieldDescription
#Sequence number (order)
ActiveEnabled/Disabled (toggle)
ActionPass (green), Block (red), or Reject (orange)
DirectionIn or Out
InterfaceNetwork interface (WAN, LAN, etc.)
ProtocolTCP, UDP, ICMP, etc.
SourceSource address or alias (with NOT indicator)
DestinationDestination address or alias (with NOT indicator)
GatewayAssigned gateway
LogWhether the rule is logged
CategoriesAssigned categories as colored chips
DescriptionFree-text description

Creating Rules

Click Add Rule to create a new rule. Optionally select a template:

TemplateDescription
EmptyEmpty rule for manual configuration
Allow HTTP/HTTPSAllow web traffic (port 80/443)
Allow SSHAllow SSH access (port 22)
Allow DNSAllow DNS queries (port 53)
Allow ICMPAllow ping
Allow SMTPAllow email sending (port 25/587)
Allow WireGuardAllow WireGuard VPN
Allow OpenVPNAllow OpenVPN
Allow IPsecAllow IPsec VPN
Block AllBlock all traffic

Editing Rules

The edit form is divided into sections:

Organization:

  • Enabled/Disabled
  • Assign categories
  • Description

Interface:

  • Interface selection (including "Floating (all)" for all interfaces)
  • Invert interface (NOT)

Filter:

  • Quick rule (optimized processing)
  • Action: Pass, Block, Reject
  • Direction: In, Out
  • IP Version: IPv4, IPv6, IPv4+IPv6
  • Protocol: Any, TCP, UDP, TCP/UDP, ICMP, ESP, AH, GRE, IGMP, PIM, OSPF

Source:

  • Source address via network selector (see below)
  • Invert source (NOT)
  • Source port

Destination:

  • Destination address via network selector
  • Invert destination (NOT)
  • Destination port

Advanced:

  • Gateway selection
  • Enable logging

Network Selector

The network selector is an intelligent dropdown that groups different address types:

GroupOptions
Generalany (any address), (self) (firewall itself)
Interface AddressesIP address of each interface (e.g., LAN address, WAN address)
Interface NetworksSubnet of each interface (e.g., LAN net, WAN net)
AliasesAll configured aliases
Single Host or NetworkManual input of an IP/subnet

Reordering Rules

The order of rules determines processing priority. Use the arrow buttons (up/down) to reorder rules.

Protected Rules

Rules with DATAZONE-PROTECT in the description are protected and cannot be edited or deleted. These are automatically created by DATAZONE Control (e.g., WireGuard WAN rules).

Aliases

Aliases are named groups of IP addresses, networks, or URLs that can be used in firewall rules. They greatly simplify rule management.

Alias Types

TypeDescriptionExample
Host(s)Individual IP addresses or hostnames192.168.1.100, server.example.com
Network(s)IP subnets in CIDR notation192.168.1.0/24, 10.0.0.0/8
URL Table (IPs)URL providing an IP listBlocklist URLs
URL TableURL providing a mixed listExternal filter lists
GeoIPCountry-based IP rangesCountry codes
ExternalExternally managed aliasesExternal sources

Creating/Editing Aliases

FieldDescription
NameUnique name (letters, numbers, underscore only)
TypeAlias type (see above)
DescriptionOptional description
ContentIP addresses, networks, or URLs (one per line)
CategoriesOptional category assignment
Protocol FilterAny, IPv4, or IPv6 (for URL types)
Update IntervalRefresh frequency for URL-based aliases

Using Aliases in Rules

Created aliases automatically appear in the network selector of firewall rules under the "Aliases" group.

Categories

Categories are used to organize firewall rules and aliases. They can be color-coded.

  • Create: Set name and color
  • Edit: Change name and color
  • Delete: Remove category (assignments are resolved)

Categories are displayed as colored chips in the rule and alias overview.

NAT Source (Outbound NAT)

Outbound NAT rules control source address translation for outgoing traffic.

Templates

TemplateDescription
EmptyEmpty rule
Outbound LANStandard NAT for LAN traffic
Outbound All InterfacesNAT for all interfaces

Rule Fields

FieldDescription
EnabledEnable/disable rule
InterfaceOutgoing interface
IP VersionIPv4, IPv6, or both
ProtocolNetwork protocol
SourceSource network (with NOT and network selector)
DestinationDestination network (with NOT and network selector)
Destination PortDestination port
Target IP (Translation)Translated source address
Target Port (Translation)Translated source port
LogEnable logging
DescriptionFree-text description

NAT Port Forward

Port forward rules redirect incoming traffic to internal servers.

Templates

TemplateDescription
EmptyEmpty rule
Port Forward HTTPHTTP forwarding (port 80)
Port Forward HTTPSHTTPS forwarding (port 443)
Port Forward RDPRDP forwarding (port 3389)
Port Forward SSHSSH forwarding (port 22)

Rule Fields

FieldDescription
EnabledEnable/disable rule
InterfaceIncoming interface (typically: WAN)
IP VersionIPv4, IPv6, or both
ProtocolNetwork protocol
SourceSource address (with NOT and network selector)
Source PortSource port
DestinationExternal destination address (with NOT and network selector)
External PortPort on the interface (public port)
Target IP (Redirect)Internal server (IP address)
Internal PortPort on the internal server
LogEnable logging
DescriptionFree-text description

Example: Forward a Web Server

To make an internal web server (192.168.1.100:443) publicly accessible, create a port forward rule on the WAN interface with external port 443 and target IP 192.168.1.100, internal port 443.

Context Menu

Right-clicking on a firewall in the table provides quick actions:

  • Open Details - Show the detail modal
  • Open WebUI - Open the OPNsense web interface in a new tab
  • Open Shell - Start a remote terminal
  • Start Tunnel - Quick access to tunnel templates
  • Start Update - Trigger a firmware update
  • Run Script - Execute a script from the library

Tunnel Templates

TemplateTarget PortDescription
OPNsense WebUI443Access to the web interface
Agent SSH22SSH via the agent
SSH22Direct SSH access
VNC5900VNC remote access
HTTP80HTTP forwarding
CustomAnyAny port

Update Schedules

TypeDescription
System UpdateOPNsense firmware update without reboot
Update + RebootUpdate followed by a reboot with optional health check

Health Check After Reboot

For update schedules with reboot, additional options can be configured:

OptionDescriptionDefault
Health check enabledAfter reboot, check whether the firewall is reachable againYes
Health check timeoutMaximum wait time for the agent heartbeat after reboot600 seconds
Auto-rebootAutomatic reboot after the updateNo

Schedules can be configured as one-time or recurring (daily, weekly, monthly, cron). See Update Schedules.

Additional Actions

ActionDescription
BackupCreate a configuration backup (config.xml)
Config SyncSynchronize configuration between HA firewalls

DATAZONE Control Documentation