wolf_xsx 发表于 2008-10-13 12:29:46

有关brazilfw限速

用BFW做路由,在限速时如果QOS设置+subnetting设定,机器一增多,就一定有延迟,游戏中卡得很,谁实验过有什么好的方法?

liyongfu 发表于 2008-10-13 20:30:00

brazilfw限速

fast Y icmp 0 0 and 0 0 # ICMP protocol
fast N tcp 3889 ffff or 3389 ffff #Windows Remote desktop (client&server)
slow N tcp 4662 ffff or 4662 ffff #eMule p2p software
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y all 16880 ff80 or 60000 ff80 #VOIP
fast Y tcp 80 ffff or 80 ffff #HTTP
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y udp 53 ffff or 53 fff0 #DNS
fast Y tcp 3128 ffff or 3128 ffff #PROXY
fast Y tcp 3128 ffff or 80 ffff #PROXY
fast Y tcp 80 ffff or 3128 ffff #PROXY
fast Y tcp 25 ffff or 25 ffff #SMTP
fast Y tcp 110 ffff or 110 ffff #POP3
fast Y tcp 5190 ff80 or 5190 ffff #MSN
fast Y tcp 6901 fffc or 6901 fffc #MSN VOICE
fast Y udp 1863 fffc or 1863 fffc #MSN
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y all 16880 ff80 or 60000 ff80 #VOIP
fast Y tcp 80 ffff or 80 ffff #HTTP
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y udp 53 ffff or 53 fff0 #DNS
fast Y tcp 3128 ffff or 3128 ffff #PROXY
fast Y tcp 3128 ffff or 80 ffff #PROXY
fast Y tcp 80 ffff or 3128 ffff #PROXY
fast Y tcp 25 ffff or 25 ffff #SMTP
fast Y tcp 110 ffff or 110 ffff #POP3
fast Y tcp 5190 ff80 or 5190 ffff #MSN
fast Y tcp 6901 fffc or 6901 fffc #MSN VOICE
fast Y udp 1863 fffc or 1863 fffc #MSN
fast Y icmp 0 0 and 0 0 # ICMP protocol
fast N tcp 3889 ffff or 3389 ffff #Windows Remote desktop (client&server)
slow Y tcp 4662 ffff or 4662 ffff #eMule
slow Y tcp 50666 ffff or 50666 ffff #uTorrent
slow Y tcp 6881 ffff or 6881 ffff #uTorrent2
fast Y tcp 53 ffff or 53 ffff #DNS
fast Y tcp 80 ffff or 80 ffff #HTTP
fast Y tcp 443 ffff or 443 ffff #HTTPS
fast Y tcp 25 ffff or 25 ffff #SMTP
fast Y tcp 110 ffff or 110 ffff #POP3
fast Y tcp 21 ffff or 21 ffff #FTP
fast Y tcp 22 ffff or 22 ffff #SSH
fast Y tcp 27020 ffff or 27020 ffff #CS
fast Y tcp 27021 ffff or 27021 ffff #CS
fast Y tcp 27022 ffff or 27022 ffff #CS
fast Y tcp 27023 ffff or 27023 ffff #CS
fast Y tcp 27024 ffff or 27024 ffff #CS
fast Y tcp 27025 ffff or 27025 ffff #CS
fast Y tcp 27026 ffff or 27026 ffff #CS
fast Y tcp 27027 ffff or 27027 ffff #CS
fast Y tcp 27028 ffff or 27028 ffff #CS
fast Y tcp 27029 ffff or 27029 ffff #CS
fast Y tcp 27030 ffff or 27030 ffff #CS
fast Y tcp 27031 ffff or 27031 ffff #CS
fast Y tcp 27032 ffff or 27032 ffff #CS
fast Y tcp 27033 ffff or 27033 ffff #CS
fast Y tcp 27034 ffff or 27034 ffff #CS
fast Y tcp 27035 ffff or 27035 ffff #CS
fast Y tcp 27036 ffff or 27036 ffff #CS
fast Y tcp 27037 ffff or 27037 ffff #CS
fast Y tcp 27038 ffff or 27038 ffff #CS
fast Y tcp 27039 ffff or 27039 ffff #CS
fast Y tcp 2106 ffff or 2106 ffff #lineageII
fast Y tcp 2009 ffff or 2009 ffff #lineageII
fast Y tcp 7777 ffff or 7777 ffff #lineageII
fast Y tcp 2000 ffff or 2000 ffff #lineageII
fast Y tcp 2003 ffff or 2003 ffff #lineageII
fast Y tcp 6112 ffff or 6112 ffff #Warcraft
fast Y tcp 6113 ffff or 6113 ffff #Warcraft
fast Y tcp 6114 ffff or 6114 ffff #Warcraft
fast Y tcp 6115 ffff or 6115 ffff #Warcraft
fast Y tcp 6116 ffff or 6116 ffff #Warcraft
fast Y tcp 6117 ffff or 6117 ffff #Warcraft
fast Y tcp 6118 ffff or 6118 ffff #Warcraft
fast Y tcp 6119 ffff or 6119 ffff #Warcraft
slow Y udp 4672 ffff or 4672 ffff #eMule
slow Y tcp 50666 ffff or 50666 ffff #uTorrent
slow Y udp 6881 ffff or 6881 ffff #uTorrent2
fast Y udp 53 ffff or 53 ffff #DNS
fast Y udp 80 ffff or 80 ffff #HTTP
fast Y udp 443 ffff or 443 ffff #HTTPS
fast Y udp 25 ffff or 25 ffff #SMTP
fast Y udp 110 ffff or 110 ffff #POP3
fast Y udp 21 ffff or 21 ffff #FTP
fast Y udp 22 ffff or 22 ffff #SSH
fast Y udp 1200 ffff or 1200 ffff #CS
fast Y udp 27000 ffff or 27000 ffff #CS
fast Y udp 27001 ffff or 27001 ffff #CS
fast Y udp 27002 ffff or 27002 ffff #CS
fast Y udp 27003 ffff or 27003 ffff #CS
fast Y udp 27004 ffff or 27004 ffff #CS
fast Y udp 27005 ffff or 27005 ffff #CS

liyongfu 发表于 2008-10-13 20:32:40

brazilfw限速

#!/bin/sh
# Custom QOS Script
# Past your own QOS script here

# ARP-QOS
# Eduardo Ricobaldi 2008-08-18
ARP_TABLE="/proc/net/arp"
QOS_CLASSES="/etc/coyote/qos.classes"

treat_line_arp() {
LINE=`echo $1`
IP=`echo "$LINE" | cut -f 1 -d " "`
IPF4=`echo "$IP" | cut -f 4 -d "."`
echo "define_class_qos "1:1" "1:1$IPF4" $QOS_DOWNSTREAM_INDIVIDUAL $QOS_DOWNSTREAM_INDIVIDUAL $QOS_UPSTREAM_INDIVIDUAL $QOS_UPSTREAM_INDIVIDUAL $IP" >> $QOS_CLASSES
}

individual() {
res=$((${1}*(100-${2})/100))
if [ $3 -gt 3 ] ; then   # > 2 + (total excluded machines)
    res=$((${res}/(${3}-2)))# wc- (1 + (total excluded machines)
fi
echo $res
}
echo "Processing ARP Table..."
echo -n > $QOS_CLASSES

MACHINES=`wc -l <$ARP_TABLE`
QOS_DOWNSTREAM_INDIVIDUAL=$(individual $QOS_DOWNSTREAM $QOS_DOWNSTREAM_JUNK $MACHINES)
QOS_UPSTREAM_INDIVIDUAL=$(individual $QOS_UPSTREAM $QOS_UPSTREAM_JUNK $MACHINES)

if [ -n "$ARP_TABLE" -a -e "$ARP_TABLE" ] ; then
echo "Scanning ARP Table"
cat $ARP_TABLE | while read TMPLINE ; do
    case "$TMPLINE" in
      IP*|"") continue;;
      "192.168.0.20 "*) continue;; # Exclude some known low traffic machine
      *) treat_line_arp "$TMPLINE";;
    esac
done
fi

QOS_TYPE="COYOTE_MANUAL"# Simulating MANUAL QOS

[ -x /etc/rc.d/rc.qos.coyote ] && . /etc/rc.d/rc.qos.coyote

QOS_TYPE="CUSTOM" # End of simulation of MANUAL QOS
你用QOS脚本看看

wolf_xsx 发表于 2008-10-13 22:21:03

我的想法是,先对每台机限速,然后在下面做限制,主要限P2P的软件;通过TC,这样通用一点,因为现在游戏爱好比较多,我们不可能把每个游戏的的端口都找到再fast。所以还是只有做脚本了,但实验麻烦,没有找到有人在网吧作实验的效果,然后说出来大家分享一下,在网吧做好了,用到其他地方就不是问题
用BFW在家里,基本没有多大问题
谢谢你的脚本

tiaoti 发表于 2009-12-24 16:33:17

顶才行~
页: [1]
查看完整版本: 有关brazilfw限速