All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan <nochoice@xs4all.nl>
To: lartc@vger.kernel.org
Subject: [LARTC] LARTC problems with PRIO qdisc
Date: Wed, 20 Oct 2004 11:55:37 +0000	[thread overview]
Message-ID: <1098273336.13159.37.camel@morpheus> (raw)

Hi,

I have a router/firewall running Linux (like the most of you) and I
wanted to do some traffic control.

I've created an root PRIO qdisc like the example in paragraph 9.5.3.1
(http://www.lartc.org/howto/lartc.qdisc.classful.html#AEN903) with three
SFQ child-classes.

I wanted for interactive (ssh, telnet, ftp-control) and dns-traffic to
be placed in the first queue, http should go in the second and all the
other traffic should be placed in the third queue.

For those interested these are the commands issued:
#create the queues
tc qdisc add dev eth0 root handle 1: prio
tc qdisc add dev eth0 parent 1:1 handle 10: sfq
tc qdisc add dev eth0 parent 1:2 handle 20: sfq
tc qdisc add dev eth0 parent 1:3 handle 30: sfq
#add the filters
tc filter add dev eth0 parent 1:0 protocol ip prio 1 handle 1 fw classid
1:10
tc filter add dev eth0 parent 1:0 protocol ip prio 2 handle 2 fw classid
1:20
tc filter add dev eth0 parent 1:0 protocol ip prio 3 handle 3 fw classid
1:30

Next I created some iptables rules for marking
#Traffic for band #1
iptables -t mangle -A PREROUTING -p tcp --sport 22 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p tcp --sport 22 -j RETURN
iptables -t mangle -A PREROUTING -p tcp --sport 23 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p tcp --sport 23 -j RETURN
iptables -t mangle -A PREROUTING -p tcp --sport 21 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p tcp --sport 21 -j RETURN
iptables -t mangle -A PREROUTING -p tcp --sport 53 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p tcp --dport 53 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p udp --sport 53 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p udp --dport 53 -j MARK --set-mark
0x1
iptables -t mangle -A PREROUTING -p tcp --sport 53 -j RETURN
iptables -t mangle -A PREROUTING -p tcp --dport 53 -j RETURN
iptables -t mangle -A PREROUTING -p udp --sport 53 -j RETURN
iptables -t mangle -A PREROUTING -p udp --dport 53 -j RETURN
#HTTP traffic should go to band #2
iptables -t mangle -A PREROUTING -p tcp --sport 80 -j MARK --set-mark
0x2
iptables -t mangle -A PREROUTING -p tcp --sport 80 -j RETURN
iptables -t mangle -A PREROUTING -p tcp --dport 80 -j MARK --set-mark
0x2
iptables -t mangle -A PREROUTING -p tcp --dport 80 -j RETURN
#All others should go to band #3
iptables -t mangle -A PREROUTING -j MARK --set-mark 0x3
iptables -t mangle -A PREROUTING -j RETURN

I'd have thought that should do the trick but when I issue the command:
tc -s qdisc ls dev eth0

I got this as the output:
qdisc sfq 30: quantum 1514b
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc sfq 20: quantum 1514b
 Sent 37645739 bytes 63959 pkts (dropped 0, overlimits 0)

 qdisc sfq 10: quantum 1514b
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc prio 1: bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 37671714 bytes 64170 pkts (dropped 0, overlimits 0)


As you can see all the traffic goes to 20: while it shouldn't. I thought
that iptables would mark the traffic and the tc filter commands should
direct traffic to the appropriate band.

What am I doing wrong?


Thank you for your time

Jonathan Maasland

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

             reply	other threads:[~2004-10-20 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20 11:55 Jonathan [this message]
2004-10-21 19:29 ` [LARTC] LARTC problems with PRIO qdisc Stef Coene

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1098273336.13159.37.camel@morpheus \
    --to=nochoice@xs4all.nl \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.