Skip to content

Nuface Blog

隨意隨手記 Casual Notes

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

Category: Firewall

About Firewall

OPNsense Firewall Rules: Functions & Usage

Posted on 2025-11-112025-11-11 by Rico

🧭 1. What Are Firewall Rules? Firewall rules in OPNsense define the core behavior of network traffic.They determine which packets are allowed, blocked, or rejected when traversing the firewall. Rules are evaluated at the packet filter layer, inspecting parameters such as source, destination, protocol, and port before applying the defined action. ⚙️ 2. Actions Action…

Read more

OPNsense 防火牆規則 (Firewall Rules) 功能與應用說明

Posted on 2025-11-112025-11-11 by Rico

🧭 一、什麼是防火牆規則? OPNsense 的防火牆規則 (Firewall Rules) 是系統中最核心的安全控制機制。它決定哪些網路封包可以通過、哪些必須被阻擋或拒絕。 防火牆規則運作於 封包過濾層 (Packet Filter),在資料封包進出介面時檢查來源、目的、通訊協定、埠號等條件,並根據設定的動作 (Action) 執行相應處理。 ⚙️ 二、基本概念與規則動作 動作類型 說明 Pass 允許封包通過防火牆,繼續傳輸。 Block 封鎖封包,不回覆任何訊息(靜默丟棄)。 Reject 封鎖封包並回傳拒絕訊息(TCP RST 或 ICMP unreachable)。 💡 建議:對外網 (WAN) 流量建議使用 Block,以減少被探測的機會。對內部 LAN 測試時可使用 Reject,便於除錯。 🧩 三、防火牆規則處理順序 根據官方說明,OPNsense 的防火牆規則會依以下順序處理: 1️⃣ Floating Rules(浮動規則) 跨多介面的規則會最先處理。 常用於全域封鎖、QoS 或特定方向過濾。 2️⃣ Interface Group Rules(介面群組規則) 應用於群組內的所有介面,例如:LAN + VLAN10 + VLAN20。 3️⃣ Interface Rules(單一介面規則) 最後評估每個介面上的專屬規則(如 LAN、WAN、DMZ)。…

Read more

NAT in OPNsense — Function, Use Cases & Best Practices

Posted on 2025-11-112025-11-11 by Rico

1. What is NAT? NAT (Network Address Translation) is used to translate IP addresses between internal private networks and external public networks. OPNsense documentation explains that outbound traffic from internal clients often requires the source address to be changed so the outside server can return packets. docs.opnsense.org 2. Types of NAT & Their Purpose 3….

Read more

OPNsense Firewall Automation (Official Overview)

Posted on 2025-11-112025-11-11 by Rico

🧭 Overview Firewall Automation is the new-generation framework in OPNsensefor managing firewall and source NAT rules through both the web UI and REST API. It is designed to eventually replace the classic Firewall → Rules pages,offering modern, API-driven rule management. “The automation component offers API access to firewall and source NAT rules.It only manages rules…

Read more

OPNsense 自動化防火牆規則 (Firewall Automation) — 官方功能解析與應用說明

Posted on 2025-11-112025-11-11 by Rico

🧭 一、功能概述 Firewall Automation(防火牆自動化) 是 OPNsense 新一代的防火牆與 NAT 規則管理框架。它的目標是逐步取代傳統的「Firewall → Rules」頁面,並提供更靈活、可 API 操作的規則定義方式。 📘 根據官方說明:「Automation 元件提供對防火牆與來源 NAT 規則的 API 存取介面。目前它只管理在自動化頁面中建立的規則,不會收集傳統防火牆頁面建立的規則。」 ⚙️ 二、核心概念與原理 項目 說明 自動化框架 (Automation Component) 一個基於 MVC 架構的獨立模組,用來集中管理自動化建立的防火牆與來源 NAT 規則。 UI 與 API 一致性 所有透過介面建立的規則,同時可被 REST API 呼叫與管理。 範圍限制 僅適用於「Automation」頁面建立的規則;傳統規則頁面建立的條目不會自動被收錄。 未來方向 官方將此模組視為未來新防火牆規則系統的基礎框架。 🧩 三、主要功能 1️⃣ 集中式規則定義 2️⃣ 完整 API 控制 3️⃣ MVC 架構…

Read more

OPNsense Firewall Category vs Group — Function, Usage, and Differences

Posted on 2025-11-112025-11-11 by Rico

🧭 Overview Feature Layer Purpose Affects Traffic Category Rule-level For tagging and organizing firewall rules ❌ No Group Interface/User-level For combining interfaces or users under shared policy ✅ Yes ⚙️ Category Purpose:Categories are visual tags for firewall rules.They do not change packet behavior — they simply help administrators organize, color-code, and filter rules. Use cases:…

Read more

OPNsense 防火牆 Category 與 Group 的作用、用法與差異

Posted on 2025-11-112025-11-11 by Rico

🧭 一、功能定位總覽 功能 所屬層級 主要用途 是否影響流量行為 Category (分類) 防火牆規則層 用於「標記與組織」規則,方便視覺化與搜尋 ❌ 不影響封包行為 Group (群組) 介面層 / 使用者層 用於「彙整多個介面」或「統一管理多個使用者」 ✅ 直接影響流量過濾 ⚙️ 二、Category(分類) 🧩 功能說明 Category 是 防火牆規則的標籤系統。它不會改變規則運作方式,只是提供一個邏輯分類,方便管理與視覺整理。 每一條防火牆規則可以被分配到一個或多個 Category。在 GUI 介面中,這些分類會以彩色標籤顯示在規則列表中。 📘 用途範例 🧰 設定位置 ✅ 實務建議 管理場景 建議分類方式 多部門共享同一防火牆 以部門命名分類(如 HR、IT、LOGISTICS) 專案導向 以專案名稱分類(如 D365、SAP、MAIL) 規則量大 用顏色快速區分不同功能性(例如紅色代表封鎖類規則) 🔹 重點:Category 是「管理輔助」工具,不會影響流量或優先權。 ⚙️ 三、Group(群組) 🧩 功能說明 Group…

Read more

OPNsense GeoIP Setup and Application Guide

Posted on 2025-11-102025-11-11 by Rico

🧠 1. What Is GeoIP? In enterprise network security, it’s common to require: “Block traffic from certain countries, or allow VPN access only from specific regions.” The GeoIP feature in OPNsense makes this possible.It uses IP geolocation data to create dynamic IP lists for each country or region,allowing you to apply firewall rules based on…

Read more

OPNsense GeoIP 設定與應用教學|以國家為單位的防火牆過濾策略

Posted on 2025-11-102025-11-11 by Rico

🧠 一、什麼是 GeoIP? 在企業網路安全管理中,我們常常會遇到這樣的需求: 「我想封鎖來自特定國家的連線,或只允許某些國家能登入 VPN。」 這時,OPNsense 的 GeoIP 功能就派上用場。它能根據 IP 所屬的地理位置(國家/地區) 建立動態 IP 清單,讓防火牆能夠用「國家」為單位進行過濾、允許或封鎖。 ⚙️ 二、GeoIP 的原理與資料來源 📌 簡單說: 你只要建立一個「GeoIP 別名」,例如 BLOCK_CN_RU,OPNsense 就會自動抓取中國與俄羅斯的所有 IP 段,之後在防火牆規則中選這個別名,就能一次封鎖整個國家。 🧩 三、GeoIP 的設定步驟 步驟 1️⃣:取得 MaxMind 授權金鑰 步驟 2️⃣:在 OPNsense 中啟用 GeoIP 步驟 3️⃣:建立 GeoIP 別名 🔒 四、實際應用案例 案例 1:封鎖特定國家的連線 別名名稱: BLOCK_CN_RU類型: GeoIP國家: China、Russia 防火牆規則: → 一次封鎖整個國家 IP 範圍,防止海外掃描與攻擊。…

Read more

Understanding OPNsense Aliases — Function and Practical Use

Posted on 2025-11-102025-11-10 by Rico

🧠 What Are Aliases? In a firewall, you often need to apply the same rule to multiple IPs, networks, or ports.Typing each one manually is tedious, error-prone, and hard to maintain. 👉 Aliases are reusable groups that let you define multiple IPs, hosts, networks, or ports under a single name.They make your firewall rules cleaner,…

Read more

Posts pagination

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next

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