Traffic goes not through filters.

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I think i have made an error with my filters but i can't find it.
We have a site to site tunnel and want to separate the traffic in two
queues, http and business.

I'm now filtering on protocol 8080 prio 2 and ip range prio 1.
As i read the manual i've seen that the filters are executed by prio
means that all goes trough the buisiness queue because all traffic is
for the same ip range.
And indeed i see only traffic in 1:30 and not in 1:20


Can someone tell me how to set this up ?

Thanks.


My code:

#!/bin/ksh

# QOS schema ----------------------------------------
#                 QDISC-ID 1:
#                    |
#              MAINCLASS-ID 1:1
#             /                \
#           1:20:             1:30:
#            |                  |
#   	    SQF                SQF
#        FILTER 1:          FILTER 1:
#
# 1:10 Always reserved for VOIP even not used
# 1:20 HTTP
# 1:30 All other data (could be split-up in 1:30)
#
# This script requires a parameter
#----------------------------------------------------

#set -o xtrace

# Variablen
DEV="tun3"

MAXBAND="256Kbit"

QDISC_ID="1"
QDISC_DEFAULT_HTB="10"

MAINCLASS_HANDLE="1"
MAINCLASS_ID="${QDISC_ID}:${MAINCLASS_HANDLE}"

# HANDLE 10 is reserved for VOIP
HTTP_HANDLE="20"
HTTP_CLASS_ID="${QDISC_ID}:${HTTP_HANDLE}"
HTTP_RATE="64Kbit"
HTTP_PRIO="3"

DATA_HANDLE="30"
DATA_CLASS_ID="${QDISC_ID}:${DATA_HANDLE}"
DATA_RATE="192Kbit"
DATA_PRIO="2"


# Check the parameter
case "$1" in

start)
    # The root queue
    tc qdisc add dev ${DEV} root handle ${QDISC_ID}: htb default
${QDISC_DEFAULT_HTB}
    # The main Class with the full bandwitdth of 256Kbit
    tc class add dev ${DEV} parent ${QDISC_ID}: classid ${MAINCLASS_ID}
htb rate ${MAXBAND}

    # Classes for each queue
    # HTTP 64Kbit burst MaxBand
    tc class add dev ${DEV} parent ${MAINCLASS_ID} classid
${HTTP_CLASS_ID} htb rate ${HTTP_RATE} ceil ${MAXBAND}
    tc qdisc add dev ${DEV} parent ${HTTP_CLASS_ID} handle
${HTTP_HANDLE}: sfq perturb ${HTTP_HANDLE}
    # All other traffic burst MaxBand
    tc class add dev ${DEV} parent ${MAINCLASS_ID} classid
${DATA_CLASS_ID} htb rate ${DATA_RATE} ceil ${MAXBAND}
    tc qdisc add dev ${DEV} parent ${DATA_CLASS_ID} handle
${DATA_HANDLE}: sfq  perturb ${DATA_HANDLE}

    # The Filters that will transport the traffic through the wright Class
    # HTTP
    tc filter add dev ${DEV} protocol ip parent ${QDISC_ID}: prio
${HTTP_PRIO} u32 match ip sport 8080 0xffff flowid ${HTTP_CLASS_ID}
    # Other data
    tc filter add dev ${DEV} protocol ip parent ${QDISC_ID}: prio
${DATA_PRIO} u32 match ip dst 10.32.0.0/22 flowid ${DATA_CLASS_ID}
;;


stop)
    tc qdisc del dev ${DEV} root
;;


status)
    tc -s class show dev ${DEV}
;;

esac







_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux