Skip to content

Nuface Blog

隨意隨手記 Casual Notes

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

Example: Weighted Bandwidth Shaping

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

📘 1. Objective

We have three major outbound traffic types:

ApplicationDirectionMax BandwidthPriority
Web (HTTP/HTTPS)Download2 MbpsMedium
FTPDownload1 MbpsLow
VoIP (SIP + RTP)Download2 MbpsHigh

Goal:

  1. All traffic shares one WAN interface.
  2. Total available bandwidth = 5 Mbps.
  3. Prioritize VoIP > Web > FTP.

⚙️ 2. Configuration Steps

Step 1️⃣ Create Pipes

Navigate to:

Firewall → Traffic Shaper → Pipes
NameBandwidthDescription
pipe_web2 MbpsWeb browsing and downloads
pipe_ftp1 MbpsFile transfer
pipe_voip2 MbpsVoIP traffic

Step 2️⃣ Create Queues

Firewall → Traffic Shaper → Queues
NamePipeWeightDescription
q_voippipe_voip100Highest priority
q_webpipe_web50Medium priority
q_ftppipe_ftp10Lowest priority

Step 3️⃣ Create Rules

Firewall → Traffic Shaper → Rules
NameInterfaceDirectionProtocolPort(s)QueueDescription
rule_voipWANoutUDP5060, 10000-20000q_voipSIP + RTP
rule_webWANoutTCP80, 443q_webHTTP / HTTPS
rule_ftpWANoutTCP21q_ftpFTP control and data

After saving, click Apply to activate.


Step 4️⃣ Observe Results

Check:

Firewall → Traffic Shaper → Status

During congestion:

  • VoIP flows remain smooth and low latency.
  • Web traffic remains responsive.
  • FTP sessions slow down gracefully.
Traffic TypeAvailable BandwidthPriorityLatency
VoIP2 MbpsHighLow
Web2 MbpsMediumModerate
FTP1 MbpsLowMay queue

✅ 3. Summary

This shaping setup effectively enforces bandwidth fairness and QoS priorities across different traffic classes.
By giving higher weight to time-sensitive VoIP traffic, OPNsense ensures real-time services stay smooth even when total bandwidth is limited.

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