qos |
Subversion Repositories: |
Rev 62 | Rev 63 | |
---|---|---|
Line 11... | Line 11... | |
# version: 2.1.6 |
# version: 2.1.6 | |
# ps ver : 0.1.9 |
# ps ver : 0.1.9 | |
# |
# | |
# Changelog |
# Changelog | |
# |
# | |
# 18/10/10 [simandl] upravy pro vlany | ||
# 15/10/10 [simandl] porty pro second life 12035/UDP, 12036/UDP, 12043/TCP, and 13000-13050/UDP |
# 15/10/10 [simandl] porty pro second life 12035/UDP, 12036/UDP, 12043/TCP, and 13000-13050/UDP | |
# 12/10/10 [simandl] port pro mumble 64738 |
# 12/10/10 [simandl] port pro mumble 64738 | |
# 12/10/10 [simandl] uprava ip adres LOTRO |
# 12/10/10 [simandl] uprava ip adres LOTRO | |
# 02/09/10 [simandl] pridan port 9987 pro ts3 a 3784 pro ventrilo |
# 02/09/10 [simandl] pridan port 9987 pro ts3 a 3784 pro ventrilo | |
# 12/08/10 [simandl] pridana ip 213.168.165.12 sip.fayn.cz |
# 12/08/10 [simandl] pridana ip 213.168.165.12 sip.fayn.cz | |
Line 108... | Line 109... | |
exit 1 |
exit 1 | |
fi |
fi | |
|
| |
IFACECONF=`grep -v '^[[:space:]]*#' $IFACECONFFILE` |
IFACECONF=`grep -v '^[[:space:]]*#' $IFACECONFFILE` | |
IFACECONF=`echo $IFACECONF | sed -e 's/[[:space:]]*}[[:space:]]*/}\\\n/g'` |
IFACECONF=`echo $IFACECONF | sed -e 's/[[:space:]]*}[[:space:]]*/}\\\n/g'` | |
FACES=`echo -e $IFACECONF | sed -e 's/^[[:space:]]*interface[[:space:]]\+\([[:alnum:]]\+\).*/\1/;t;d'` |
FACES=`echo -e $IFACECONF | sed -e 's/^[[:space:]]*interface[[:space:]]\+\([[:alnum:]]\+\.\?[[:alnum:]]\+\).*/\1/;t;d'` | |
|
| |
echo "Applying CZF-QOS rules" |
echo "Applying CZF-QOS rules" | |
|
| |
echo "-Set global variables" |
echo "-Set global variables" | |
IPTABLES="`which iptables`" |
IPTABLES="`which iptables`" | |
Line 628... | Line 629... | |
if [ -z "`$IP l | grep $FACE[:@]`" ] |
if [ -z "`$IP l | grep $FACE[:@]`" ] | |
then |
then | |
echo "Interface $FACE doesn't exist" |
echo "Interface $FACE doesn't exist" | |
continue |
continue | |
fi |
fi | |
TYPE=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*type[[:space:]]\+\([[:alpha:]]\+\).*}.*/\1/"` |
TYPE=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*type[[:space:]]\+\([[:alpha:]]\+\).*}.*/\1/"` | |
if [ "$TYPE" != 'transit' ] |
if [ "$TYPE" != 'transit' ] | |
then |
then | |
continue |
continue | |
fi |
fi | |
SPEED=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*speed[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
SPEED=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*speed[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
QUANTUM=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*quantum[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
QUANTUM=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*quantum[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
|
| |
if [ -z "$QUANTUM" ] |
if [ -z "$QUANTUM" ] | |
then |
then | |
MTU=`$IP l | grep $FACE[:@] | sed -e "s/^.*mtu[[:space:]]\+\([[:digit:]]\+\).*/\1/"` |
MTU=`$IP l sh $FACE | grep $FACE[:@] | sed -e "s/^.*mtu[[:space:]]\+\([[:digit:]]\+\).*/\1/"` | |
QUANTUM=$(($QUANTUMOFFS+$MTU)) |
QUANTUM=$(($QUANTUMOFFS+$MTU)) | |
fi |
fi | |
|
| |
NONCZFSPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*NONCZFSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
NONCZFSPD=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*NONCZFSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $NONCZFSPD ] ; then NONCZFSPD=$DNONCZFSPD ; fi |
if [ -z $NONCZFSPD ] ; then NONCZFSPD=$DNONCZFSPD ; fi | |
|
| |
AIRFREESPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*AIRFREESPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
AIRFREESPD=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*AIRFREESPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $AIRFREESPD ] ; then AIRFREESPD=$DAIRFREESPD ; fi |
if [ -z $AIRFREESPD ] ; then AIRFREESPD=$DAIRFREESPD ; fi | |
|
| |
NONCONTRIBSPD=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*NONCONTRIBSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
NONCONTRIBSPD=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*NONCONTRIBSPD[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $NONCONTRIBSPD ] ; then NONCONTRIBSPD=$DNONCONTRIBSPD ; fi |
if [ -z $NONCONTRIBSPD ] ; then NONCONTRIBSPD=$DNONCONTRIBSPD ; fi | |
|
| |
SSHDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*SSHDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
SSHDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*SSHDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $SSHDIV ] ; then SSHDIV=$DSSHDIV ; fi |
if [ -z $SSHDIV ] ; then SSHDIV=$DSSHDIV ; fi | |
|
| |
PINGDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*PINGDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
PINGDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*PINGDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $PINGDIV ] ; then PINGDIV=$DPINGDIV ; fi |
if [ -z $PINGDIV ] ; then PINGDIV=$DPINGDIV ; fi | |
|
| |
INTERACTDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*INTERACTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
INTERACTDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*INTERACTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $INTERACTDIV ] ; then INTERACTDIV=$DINTERACTDIV ; fi |
if [ -z $INTERACTDIV ] ; then INTERACTDIV=$DINTERACTDIV ; fi | |
|
| |
VOIPDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*VOIPDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
VOIPDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*VOIPDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $VOIPDIV ] ; then VOIPDIV=$DVOIPDIV ; fi |
if [ -z $VOIPDIV ] ; then VOIPDIV=$DVOIPDIV ; fi | |
|
| |
WWWDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*WWWDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
WWWDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*WWWDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $WWWDIV ] ; then WWWDIV=$DWWWDIV ; fi |
if [ -z $WWWDIV ] ; then WWWDIV=$DWWWDIV ; fi | |
|
| |
XFERDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*XFERDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
XFERDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*XFERDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $XFERDIV ] ; then XFERDIV=$DXFERDIV ; fi |
if [ -z $XFERDIV ] ; then XFERDIV=$DXFERDIV ; fi | |
|
| |
DFLTDIV=`echo -e $IFACECONF | grep $FACE | sed -e "s/^.*{.*DFLTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` |
DFLTDIV=`echo -e $IFACECONF | grep $FACE" " | sed -e "s/^.*{.*DFLTDIV[[:space:]]\+\([[:digit:]]\+\).*}.*/\1/;t;d"` | |
if [ -z $DFLTDIV ] ; then DFLTDIV=$DDFLTDIV ; fi |
if [ -z $DFLTDIV ] ; then DFLTDIV=$DDFLTDIV ; fi | |
|
| |
#echo $SPEED $NONCZFSPD $AIRFREESPD $SSHDIV $PINGDIV $INTERACTDIV $VOIPDIV $WWWDIV $XFERDIV $DFLTDIV |
#echo $SPEED $NONCZFSPD $AIRFREESPD $SSHDIV $PINGDIV $INTERACTDIV $VOIPDIV $WWWDIV $XFERDIV $DFLTDIV | |
set_qos_classes |
set_qos_classes | |
done |
done |