论坛风格切换切换到宽版
  • 513阅读
  • 1回复

[问题求助]u32 filter VS fwmark filter [复制链接]

上一主题 下一主题
离线areyousure.
 
发帖
1992
C币
-199332
威望
360
贡献值
1
银元
-1
铜钱
4442
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
做流量控制.,.请教使用u32过滤和fwmark过滤,哪个性能好?<性病>

如何测试?谢谢!!

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线icelee.
发帖
2030
C币
-262745
威望
411
贡献值
1
银元
-1
铜钱
4655
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
Re:u32
#!/bin/sh

tc filter add dev eth2 protocol ip parent 1: prio 1 handle 1 fw classid 1:11
tc filter add dev eth2 protocol ip parent 1: prio 2 handle 2 fw classid 1:12
#!/bin/sh
tc filter add dev eth2 protocol ip parent 1: prio 1 u32 match ip sport 80 0xffff flowid 1:11
tc filter add dev eth2 protocol ip parent 1: prio 2 u32 match ip sport 22 0xffff flowid 1:12
#以上u32脚本


#!/bin/sh
/usr/sbin/iptables -t mangle -A PREROUTING -p tcp --sport 80 -j MARK --set-mark 1
/usr/sbin/iptables -t mangle -A PREROUTING -p tcp --sport 80 -j RETURN

/usr/sbin/iptables -t mangle -A PREROUTING -p tcp --sport 22 -j MARK --set-mark 2
/usr/sbin/iptables -t mangle -A PREROUTING -p tcp --sport 22 -j RETURN
#以上fwmark脚本

快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个