0

嗨,我需要将指定的端口范围(例如从 16384 到 32768)与 tcng 匹配,以便为从该端口传出的流量提供更高的优先级。

示例文件:

#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();
            }
        }
    }
}

我应该怎么办?提前致谢。

4

1 回答 1

0

看起来像一个简单的“udp_sport >= 16384 && udp_sport <= 32768”的作品。
至少在 tcng 版本 10b 中。
所以这样写:

#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();
            }
        }
    }
}
于 2013-01-08T12:29:19.707 回答