OPNsenseXXXIII · Logging and Remote LoggingRemote forwarding
Remote syslog to observability — forwarding OPNsense logs to a SIEM or log server
What you'll learn
- Configure remote syslog forwarding on OPNsense — transport, format, destination
- Set up TLS with mutual certificate validation
- Route specific facilities to specific destinations
- Verify end-to-end forwarding using logger and tcpdump
- Diagnose the common remote-forwarding failures
Prerequisites
Verified against OPNsense 25.x · FreeBSD 14.x · PF (FreeBSD packet filter) FreeBSD 14.x · Unbound 1.20+ · Kea DHCP OPNsense 25.x plugin · WireGuard in-kernel + OPNsense plugin · strongSwan (IPsec plugin) OPNsense 25.x plugin · OpenVPN 2.6.x · Suricata 7.x · 2026-08-14
Remote syslog forwarding is the integration point between OPNsense and the rest of the estate’s observability stack. The firewall produces logs; the SIEM, log server, or cloud destination consumes them. The configuration is straightforward — a destination, a transport, an optional certificate, and a per-facility rule. The discipline is in the verification: confirming the messages actually arrive, that they arrive in the right format, and that the forwarding survives reboots, link failures, and certificate renewals.
The GUI configuration
System → Settings → Logging, “Remote” tab, is the entry point. Each destination is a separate row with these fields:
- Enabled: per-destination toggle.
- Transport: UDP, TCP, or TLS, each over IPv4 or IPv6 — the IP version is part of the choice, not a separate field.
- Applications: the programs to forward. Empty means all of them.
- Levels: the severities to forward. Empty means all of them.
- Facilities: the facilities to forward. Empty means all of them.
- Hostname: the destination host or address.
- Port: defaults to 514.
- Certificate: the client certificate presented on TLS transports.
- Description: free text, used to label the destination.
There is also an RFC 5424 toggle, off by default, which sends the structured format instead of the older BSD format. Note the asymmetry: the local files are always written in RFC 5424, but forwarding falls back to RFC 3164 unless this is switched on.
$ configctl syslog status; echo '---'; grep -i 'syslog-ng' /var/log/system/latest.log | tail -2Checking syslog-ng status. Running
---
<131>1 2026-08-14T16:30:02+00:00 opnsense.example.com syslog-ng 61204 - [meta sequenceId="813"] Syslog connection established; fd='14', server='AF_INET(198.51.100.60:6514)', local='AF_INET(0.0.0.0:0)'
<131>1 2026-08-14T16:41:57+00:00 opnsense.example.com syslog-ng 61204 - [meta sequenceId="907"] Syslog connection broken; fd='14', server='AF_INET(198.51.100.60:6514)', time_reopen='60'
Illustrative output
Per-facility routing
OPNsense supports sending different facilities to different destinations. The use cases:
- Security logs (PF, IDS, auth) → SIEM over TLS.
- Operational logs (system, services) → log aggregation over TCP.
- Debug-level noise → local sink only.
The configuration is the Applications, Levels, and Facilities fields on each destination. Each is a multi-select, each defaults to empty meaning “everything”, and a destination that sets more than one narrows on all of them at once — a destination with Applications set to filterlog and Levels set to notice and above forwards only filter records at notice or above.
TLS setup
TLS syslog requires certificates on both ends:
On the OPNsense side:
- The CA certificate that signed the receiver’s certificate must be in OPNsense’s trust store. Import via System → Trust → Authorities.
- Optionally, a client certificate for mutual TLS. Import via System → Trust → Certificates.
On the receiver side:
- A server certificate signed by a CA the firewall trusts. The certificate’s CN or SAN must match the destination hostname (so the firewall can validate it).
- Optionally, the CA that signed the firewall’s client certificate, to validate mutual TLS.
The receiver’s configuration (rsyslog example):
# rsyslog.conf
module(load="imtcp"
StreamDriver.Name="gtls"
StreamDriver.Mode="1" # require TLS
StreamDriver.AuthMode="x509/certvalid"
PermittedPeer="opnsense.example.com"
)
input(type="imtcp" port="6514")
StreamDriver.Mode="1" requires TLS — connections without TLS are rejected. PermittedPeer validates the firewall’s certificate against the expected CN/SAN. x509/certvalid checks the chain against the trust store.
$ openssl s_client -connect siem.example.com:6514 -CAfile /etc/ssl/siem-ca.crt 2>&1 | grep -E 'subject=|issuer=|verify return|Protocol'subject=CN = siem.example.com
issuer=CN = OPNsense Internal CA, O = Estate Internal
verify return:1
Protocol : TLSv1.3
Illustrative output
Verification
The end-to-end check uses logger to inject a known test message and tcpdump (or the receiver’s logs) to confirm it arrived.
$ logger -p local0.notice -t test-forward 'verify remote forwarding 12345'; sleep 2; grep 'verify remote' /var/log/system/latest.log<133>1 2026-08-14T16:30:01+00:00 opnsense.example.com test-forward 62110 - [meta sequenceId="8321"] verify remote forwarding 12345
Illustrative output
The second check is over time. The operator should confirm:
- Steady-state forwarding — a continuous flow of messages from the firewall.
- No reconnection storms —
syslog-ngshould reconnect once after a remote restart, not once a minute. The system log records each break and each re-establishment, so the pattern is visible without touching the receiver. - No certificate errors — TLS handshake should succeed on every reconnection.
Common failures
The remote-forwarding deployment has a few characteristic failure modes:
| Symptom | Likely cause | Fix |
|---|---|---|
| No messages at receiver | syslog-ng not running, destination not enabled, firewall blocking the port | Check configctl syslog status, enable the destination, open the port |
| TLS handshake failures | Certificate expired, hostname mismatch, untrusted CA | Renew certificate, fix SAN, import CA |
| Sporadic drops | Network congestion, receiver overloaded, TCP retransmits | Increase receiver capacity, check network |
| Reconnection loops | Receiver bouncing, certificate issue, network flap | Check receiver logs, certificate |
| Wrong format at receiver | RFC mismatch between sender and receiver | Match RFC version (both 5424 or both 3164) |
| Messages arrive but with wrong facility | Facility mismatch in routing | Verify syslog.conf routing |
Capacity planning
Forwarding volume matters. A firewall with TLS interception and Suricata may produce thousands of log lines per second at peak. The receiver must be able to absorb that:
- Disk I/O: the receiver writes every message to disk. SSD is recommended; spinning disk is the bottleneck for high-volume syslog.
- Network bandwidth: each syslog message is 100 to 1000 bytes. At 10,000 messages per second, the bandwidth is 1 to 10 MB/s. The link between the firewall and the receiver must carry this.
- Indexing: the SIEM (Splunk, Elastic) indexes every field. Indexing is CPU-intensive; budget for it.
The operator who deploys remote forwarding without sizing the receiver has built a system that drops messages under load. The discipline: size the receiver for peak volume, monitor queue depth, alert on drops.
Multiple destinations
Some estates split forwarding across destinations:
- SIEM (Splunk, Elastic) for security-relevant logs.
- Log aggregation (Graylog, Loki) for operational logs.
- Cloud-native (Datadog, Grafana Cloud) for vendor-managed retention.
OPNsense supports multiple destinations with per-destination facility filters. The configuration is in the GUI. The discipline: use one destination by default; add others with reason.
Knowledge check · 3 questions
Q1. TLS handshake fails when the firewall tries to forward logs to siem.example.com:6514. The receiver has a valid certificate signed by a public CA. What is the most likely cause?
Q2. The default remote-forwarding deployment should send every log facility to one SIEM, with the SIEM handling internal routing by facility and severity.
Q3. Which of the following are required for a working TLS syslog deployment? Select all that apply.
Passing score: 75%. Answers are checked in this browser.