tcng - 匹配“if”語句中的端口範圍 (tcng - match port range in "if" statement)


問題描述

tcng ‑ 匹配“if”語句中的端口範圍 (tcng ‑ match port range in "if" statement)

Hi I need to match a specified port range (say from 16384 to 32768) with tcng in order to give traffic outgoing from this ports an higher priority.

Example file:

#include "fields.tc"
dev "eth0" {
    egress {
        class(<$voip>) if ip_proto == IPPROTO_UDP && udp_sport == ...;
        class(<$other>) if 1;
        prio {
            $voip = class(1) {
                fifo();
            }
            $other = class(2) {
                fifo();
            }
        }
    }
}

What should I do? Thanks in advance.

‑‑‑‑‑

參考解法

方法 1:

looks like a simple "udp_sport >= 16384 && udp_sport <= 32768" works. at least in tcng version 10b. so write it like this:

#include "fields.tc"
dev "eth0" {
    egress {
        class(<$voip>) if ip_proto == IPPROTO_UDP && udp_sport >= 16384 && udp_sport <= 32768;
        class(<$other>) if 1;
        prio {
            $voip = class(1) {
                fifo();
            }
            $other = class(2) {
                fifo();
            }
        }
    }
}

(by ipersiteDomeDan)

參考文件

  1. tcng ‑ match port range in "if" statement (CC BY‑SA 3.0/4.0)

#controls #range #linux #traffic






相關問題

如何在不阻塞的情況下用大量信息填充列表視圖? (How to populate listview with a lot of information without blocking?)

查看項目是否在列錶框控件中的最有效方法 (Most efficient way to see if an item is or is not in a listbox control)

tcng - 匹配“if”語句中的端口範圍 (tcng - match port range in "if" statement)

將圖像加載到面板 (Load image to panel)

Cycle2 Plugin Ẩn / Hiện các nút jQuery (Cycle2 Plugin Hide/Show buttons jQuery)

如何使用 Windows 資源管理器顯示項目和詳細信息展開/折疊 (How to Display Items and Details with Windows Explorer Expand/Collapse)

ASP.NET 2.0 JQuery AJAX 登錄 (ASP.NET 2.0 JQuery AJAX Login)

單步執行控件看不到第二個下拉菜單 (Step through controls fail to see second dropdown)

用戶控件、服務器控件和自定義控件之間有什麼區別? (What are the differences between User Controls, Server Controls & Custom Controls?)

GroupBox 控件中的圓角 (Rounded corners in GroupBox control)

在 .NET 中編寫大型多步驟表單的最有效方法是什麼? (Most efficient way to code a large multi-step form in .NET?)

如何從 ASP .NET MVC 中的動態生成控件中獲取數據? (How can I get data from dynamic generated controls in ASP .NET MVC?)







留言討論