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

  • Building an Internal API Platform with Python, Flask, Docker, and Apache Reverse Proxy
  • 打造企ζ₯­ε…§ιƒ¨ API εΉ³ε°οΌšδ½Ώη”¨ Python + Flask + Docker + Apache Reverse Proxy
  • 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

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
  • Python
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme