Michelle escreveu:#!/bin/sh
#
# Coyote QOS init Script
# Author: Dolly <dolly@czi.cz>
# Revision by BFW user "marcos do vale" - 02/04/2008
# Add "Clean Subnet QOS Chain" code, "QOS_flush" function and IMQ support
# Revision by BFW user "marcos do vale" - 09/10/2008
# Add "percentage" function from /etc/qos.config file
# Load default QOS values
. /etc/qos.config
# always Load Coyote variables, overwrite defaults
. /etc/coyote/coyote.conf
iptables="/usr/sbin/iptables"
tc="/usr/sbin/tc"
ip="/bin/ip"
#Atençao !!!! As linhas, ou o "pedaço" do script que é citada no forum ja se encontra no seu arquivo...
# counts bandwidth percentage, awoids zero results.
percentage () {
res=$((${1}*${2}/100))
[ $res -eq 0 ] && res=1
echo $res
}
[ -e /tmp/netsubsys.state ] && . /tmp/netsubsys.state
if [ -z "$IF_INET" ]; then
if [ "$INETTYPE" != "PPPOE" ] && [ "$INETTYPE" != "PPP" ]; then
IF_INET=eth1
else
IF_INET=ppp0
fi
logger -p daemon.info -t rc.qos "QOS script called with default: ${IF_INET}"
else
[ "$INETTYPE" = "PPPOE" -o "$INETTYPE" = "PPP" ] && IF_INET=ppp0
logger -p daemon.info -t rc.qos "QOS script called with: ${IF_INET}"
fi
DOWNSTREAM_JUNK=$(percentage $QOS_DOWNSTREAM $QOS_DOWNSTREAM_JUNK)
UPSTREAM_JUNK=$(percentage $QOS_UPSTREAM $QOS_UPSTREAM_JUNK)
UP_FW_STREAM=$(percentage $QOS_UPSTREAM $QOS_UPFW_STREAM)
CLEAR_UPSTREAM=$((${QOS_UPSTREAM}-${UPSTREAM_JUNK}))
CLEAR_DOWNSTREAM=$((${QOS_DOWNSTREAM}-${DOWNSTREAM_JUNK}))
COMP_DOWN=$(percentage $CLEAR_DOWNSTREAM $QOS_DOWNSTREAM_INDIVIDUAL)
COMP_UP=$(percentage $CLEAR_UPSTREAM $QOS_UPSTREAM_INDIVIDUAL)
# Flush rules
QOS_flush() {
echo "* Deleting old QOS classes in $1 Interface..."
$tc qdisc del dev $1 root 2> /dev/null
echo "* Deleting old root filters in $1 Interface..."
$tc filter del dev $1 parent 1:2 pref 100 2>/dev/null
$tc filter del dev $1 parent 1:1 pref 100 2>/dev/null
$tc filter del dev $1 parent 1: pref 100 2>/dev/null
}
QOS_flush $IF_INET
QOS_flush $IF_LOCAL
[ -n "$IF_LOCAL2" ] && QOS_flush $IF_LOCAL2
[ -n "$IF_LOCAL3" ] && QOS_flush $IF_LOCAL3
[ -n "$IF_LOCAL4" ] && QOS_flush $IF_LOCAL4
[ -n "$IF_WLAN" ] && QOS_flush $IF_WLAN
[ -n "$IF_DMZ" ] && QOS_flush $IF_DMZ
$ip link | grep imq | grep UP >/dev/null
if [ $? = 0 ]; then
$tc qdisc del dev imq0 root
# $tc qdisc del dev imq1 root
$ip link set imq0 down
# $ip link set imq1 down
$iptables -t mangle -F qos_IMQ 2> /dev/null
[ $? = 0 ] && { $iptables -t mangle -D PREROUTING -j qos_IMQ; $iptables -t mangle -X qos_IMQ; }
fi
case "$QOS_TYPE" in
WONDERSHAPER)
echo "QOS: Attention: Wonder-shaper QOS scripts are not supported anymore... sorry.";;
CUSTOM)
echo "QOS: using Custom QOS script."
[ -x /etc/rc.d/rc.qos.custom ] && . /etc/rc.d/rc.qos.custom
echo "QOS: init complete";;
SUBNET)
echo "QOS: using Subnet QOS script."
[ -x /etc/rc.d/rc.qos.subnet ] && . /etc/rc.d/rc.qos.subnet
echo "QOS: init complete";;
COYOTE_DEFAULT|COYOTE_MANUAL)
echo "QOS: using Coyote QOS init scripts ..."
[ -x /etc/rc.d/rc.qos.coyote ] && . /etc/rc.d/rc.qos.coyote
echo "QOS: init complete";;
*) echo "QOS: QOS installed, but disabled ...";;
esac
Não acredito que tenha que mexer em nada no Qos, nao nesse script.
Michelle, percebo também uma certa "lerdeza" quando se refere a sub redes, o ping realmente se eleva, com certeza com alguns ajustes da pra diminuir estes tempos.
Nao sei quanto a navegaçao, mas existe algo muito importante que é nao usar toda a banda disponivel.
O recomendado seria algo em torno dos 70% , por incrivel que pareça....rsrs
Abrass garota...