Skip to content

Nuface Blog

隨意隨手記 Casual Notes

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

Blog

Example: Weighted Bandwidth Shaping

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

📘 1. Objective We have three major outbound traffic types: Application Direction Max Bandwidth Priority Web (HTTP/HTTPS) Download 2 Mbps Medium FTP Download 1 Mbps Low VoIP (SIP + RTP) Download 2 Mbps High Goal: ⚙️ 2. Configuration Steps Step 1️⃣ Create Pipes Navigate to: Name Bandwidth Description pipe_web 2 Mbps Web browsing and downloads…

Read more

OPNsense Traffic Shaping 實際設定範例

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

📘 一、範例目標 假設企業內部共有三類主要應用: 應用 流量方向 頻寬上限 優先權 Web 流量 (HTTP/HTTPS) Download 2 Mbps 中 FTP 檔案傳輸 Download 1 Mbps 低 VoIP 語音通話 Download 2 Mbps 高 希望達到以下效果: ⚙️ 二、設定步驟 Step 1️⃣ 建立 Pipes 進入: 建立三條下載管道: 名稱 頻寬 說明 pipe_web 2 Mbps 限制一般 HTTP/HTTPS 下載 pipe_ftp 1 Mbps 限制 FTP 傳輸頻寬 pipe_voip 2 Mbps 限制 VoIP…

Read more

Introduction to Traffic Shaping in OPNsense

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

🧭 1. What is Traffic Shaping? Traffic shaping is the control of network traffic to optimize or ensure performance, reduce latency, and increase usable bandwidth by applying additional delay or restrictions to packet flows. In OPNsense, traffic shaping is implemented via pipes, queues, and rules. The rules manage flows and assign them to pipes/queues based…

Read more

OPNsense中的頻寬管理簡介

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

🧭 一、什麼是 Traffic Shaping? Traffic Shaping(流量整形,也稱為封包整形/packet shaping)是一種網路流量控制技術,藉由對特定封包集合(流/flow)施加延遲或控制,使其符合預定的頻寬、優先順序或延遲要求。 在 OPNsense 中,Traffic Shaper 提供「管道 (Pipes)」「佇列 (Queues)」「規則 (Rules)」三個構件來實現,並可設定來源/目的 IP、介面、方向 (進/出)、通訊埠等條件。 ⚙️ 二、構成元件與原理 運作流程:使用者/裝置封包依來源、目的、介面、埠號等條件匹配到一條「Shaper Rule」,該規則將封包導向某條 Pipe,再透過該 Pipe 下的 Queue 依權重分配頻寬。若該流量達到管道上限,則多餘封包會被排隊或延遲。 🧩 三、主要應用場景 🧰 四、如何在 OPNsense 中設定 Step 1:建立 Pipes 前往:Firewall → Traffic Shaper → Pipes新增下載/上傳管道,設定頻寬、描述等。 Step 2:建立 Queues(如需權重) 前往:Firewall → Traffic Shaper → Queues選擇所屬 Pipe,設定權重 (weight)、遮罩 (mask)(如以來源或目的 IP 平分頻寬)等。…

Read more

Double NAT Issue with OPNsense (Resolved by Direct PPPoE Connection)

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

🧭 1. Background During internal testing, my setup was: Node IP / Role Test Host 192.168.100.250 (GW: 192.168.100.253) OPNsense LAN 192.168.100.253 OPNsense WAN 172.16.100.253 (GW: 172.16.100.251) UserGW LAN 172.16.100.251 UserGW WAN PPPoE (Internet) The test host attempted to SSH to an external server.The external server received connection attempts (logged in iptables),but the SSH client always…

Read more

OPNsense 雙層 NAT 造成連線失敗問題與解決過程

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

🧭 一、問題背景 在內部測試 OPNsense 時,我建立了如下的測試環境: 節點 IP / 功能 測試主機 192.168.100.250(GW: 192.168.100.253) OPNsense LAN 192.168.100.253 OPNsense WAN 172.16.100.253(GW: 172.16.100.251) UserGW LAN 172.16.100.251 UserGW WAN PPPoE 外網連線 測試主機透過 OPNsense → UserGW → 外網連線至外部 SSH Server。結果外部主機收到封包(可在 iptables log 中看到),但測試主機端 SSH 連線卻一直顯示 “Connection timed out”。 🧩 二、問題分析 從外部伺服器的日誌可看到封包來源為: 這代表: 也就是典型的「雙層 NAT」架構。雖然封包能送出,但回程封包無法正確對應回 OPNsense 的狀態表。 🔍 結果: ⚙️ 三、排查過程 1️⃣…

Read more

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 中的 NAT — 功能、用例和最佳實踐

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

一、NAT 是什麼? NAT(Network Address Translation,網路地址轉換)是一項讓防火牆/路由器能在內部私有 IP 與外部公有 IP 之間做轉換的機制。官方說明指出,當使用者/裝置從內部網路對外進行連線時,NAT 可以替換封包的來源 IP/目的 IP,使封包能正常往返。 docs.opnsense.org 二、NAT 的類型與作用 官方文件中指出了兩大類型: 三、為什麼需使用 NAT? 四、在 OPNsense 中的設定方式與注意點 根據官方文件,你在 OPNsense 的操作可參考以下流程: 4.1 Port Forwarding (DNAT) 4.2 Outbound NAT (SNAT) 五、實際應用範例 六、注意事項與最佳實務 七、總結 NAT 功能是 OPNsense 中不可或缺的一環,用以處理內部與外部網路的 IP 與連線邏輯。掌握 DNAT(目的轉譯)與 SNAT(來源轉譯)的差異及應用場景,能讓企業環境中內外部服務、頻寬共享、與多 WAN 架構運作得更穩定。合理使用 Port Forwarding、Outbound NAT 與 Reflection NAT,搭配過濾規則,構建安全且可控的網路架構。

Read more

Posts pagination

  • Previous
  • 1
  • …
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • …
  • 29
  • Next

Recent Posts

  • Cleaning Up Unused Let’s Encrypt Certificates in a Docker Certbot Environment
  • 使用 Docker Certbot 刪除不再使用的 Let’s Encrypt 憑證
  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix

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