Skip to contentSkip to conversation

QoS and CLASSIFY

LARTC Paulo Ricardo Bruck 2 participants 2 messages May 31, 2005

lore
Share & tools
lore
#0 lore raw

Hi Guys

After googling a little I couldn't find the correct answer..

When I use :
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.0.11 flowid 1:30 , I can shape traffic to 1:30.( works like a charm)

Now instead tc filter I would like to use CLASSIFY as below:

iptables -t mangle -A POSTROUTING -o eth0 -d 192.168.0.5 -j CLASSIFY --set-class 1:30

but when I comment tc filter and include iptables -t mangle..CLASSIFY nothing works.

Where Am I wrong??

Scenario:

#!/bin/bash
#
# 128Kbps 192.168.0.1
# <----- eth1 firewall eth0
# internet-adsl-----+squid---------------4 desktops
# -----> +QoS 192.168.0.5

#       450Kbps                                     .11
#                                                   .12
#                                                   .20

#
modprobe sch_htb sch_prio sch_sfq cls_u32
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 htb

tc class add dev eth0 parent 1:0 classid 1:1 htb rate 450kbit ceil 450kbit

tc class add dev eth0 parent 1:1 classid 1:30 htb rate 80kbit ceil 400kbit
tc class add dev eth0 parent 1:1 classid 1:40 htb rate 80kbit ceil 400kbit
tc class add dev eth0 parent 1:1 classid 1:50 htb rate 80kbit ceil 400kbit
tc class add dev eth0 parent 1:1 classid 1:60 htb rate 80kbit ceil 400kbit

tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10 tc qdisc add dev eth0 parent 1:40 handle 40: sfq perturb 10 tc qdisc add dev eth0 parent 1:50 handle 50: sfq perturb 10 tc qdisc add dev eth0 parent 1:60 handle 60: sfq perturb 10

thanks in advanced

Signature · 1 line
Paulo Ricardo Bruck - consultor

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw
Quoted 11 lines · Paulo Ricardo Bruck

Hi Guys

After googling a little I couldn't find the correct answer..

When I use :
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.0.11 flowid 1:30 , I can shape traffic to 1:30.( works like a charm)

Now instead tc filter I would like to use CLASSIFY as below:

Quoted 7 lines

iptables -t mangle -A POSTROUTING -o eth0 -d 192.168.0.5 -j CLASSIFY --set-class 1:30

but when I comment tc filter and include iptables -t mangle..CLASSIFY nothing works.

Where Am I wrong??

Your rules look OK and a quick test based on them works for me.

You need a recent kernel with classify selected and recent iptables.

I notice you modprobe some stuff - I use modules but don't need to modprobe anything, this is what autoloads -

sch_sfq                 5184  2
sch_htb                15488  1
ipt_CLASSIFY            2176  2
iptable_mangle          2496  1
ip_tables              19728  2 ipt_CLASSIFY,iptable_mangle

You can check counters with

iptables -L POSTROUTING -vnt mangle

tc -s qdisc ls dev eth0

tc -s class ls dev eth0

Andy.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc