Skip to content

Nuface Blog

隨意隨手記 Casual Notes

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

OPNsense Firewall Normalization — Principle & Configuration Guide

Posted on 2025-11-122025-11-12 by Rico

🧭 1. What is Packet Normalization?

In OPNsense, Firewall Normalization (or “scrubbing”) is a low-level packet filtering feature
implemented by the pf firewall engine, which cleans, verifies, and adjusts packets before they are processed by rules.

Its main purposes are:

  • Correct or drop malformed packets;
  • Reassemble fragmented packets;
  • Prevent fragmentation-based evasion attacks;
  • Improve protocol compliance and consistency.

You can find it under:

Firewall → Settings → Normalization

⚙️ 2. How It Works

When a packet passes through the firewall, pf performs a scrub operation:
checking headers, fixing anomalies, and normalizing flow behavior.

Common scrub actions:

ActionDescription
reassemble tcpReassemble fragmented TCP packets to prevent evasion.
random-idRandomize IP packet ID to avoid traffic fingerprinting.
min-ttl 64Enforce minimum TTL to prevent early packet drop.
max-mss 1460Cap the TCP segment size to ensure link compatibility.
no-dfRemove “Don’t Fragment” flag, allowing reassembly when needed.

🧩 3. Normalization Options

OptionDescription
Disable packet reassemblyDisables reassembly; not recommended unless performance is critical.
Randomize IDObfuscates host activity by randomizing IP IDs.
Min TTLMinimum allowed TTL (e.g., 64).
Max MSSLimits TCP segment size (commonly 1460).
No-dfAllows fragmentation even if DF flag is set.
Adaptive timeoutsDynamically adjusts timeouts for high-load conditions.

🧠 4. Use Cases

1️⃣ Prevent Fragmentation Attacks
Some exploits use small, fragmented packets to bypass IDS/IPS.
Reassembly ensures packets are unified and inspected correctly.

2️⃣ Fix MTU / VPN Issues
Setting Max MSS = 1460 avoids oversized packets from breaking through smaller-MTU links like PPPoE or VPN tunnels.

3️⃣ Enhance Privacy
Randomize ID hides host behavior from remote fingerprinting attempts.

4️⃣ Increase Connection Reliability
Min TTL = 64 helps maintain connectivity across multiple routing hops.


⚙️ 5. Example Configuration

For WAN interface normalization:

InterfaceOptionValue
WANEnable reassembly✅ Enabled
Randomize ID✅ Enabled
Min TTL64
Max MSS1460
No-df✅ Enabled

Equivalent CLI command:

scrub on em0 reassemble tcp random-id min-ttl 64 max-mss 1460 no-df

🧩 6. Recommended Practices

ScenarioSuggested Settings
General corporate networkreassemble tcp + random-id + min-ttl=64
VPN usersadd max-mss 1400–1420
High-performance serversdisable reassembly if CPU-bound
High-security environmentenable random-id + no-df

✅ 7. Summary

Packet Normalization is a powerful and often overlooked feature that
protects your network from protocol irregularities and packet-based attacks.
By enforcing consistent packet structure before filtering,
it greatly enhances both security and stability of your OPNsense firewall.

Always keep it enabled unless you have a specific performance reason not to,
and tune MSS/TTL based on your environment.

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