From: Shao Ming shaoming@signetique.com
To: lartc@vger.kernel.org
Subject: [LARTC] Controlling outgoing bandwidt based on port number.
Date: Thu, 08 Feb 2001 10:40:23 +0000 [thread overview]
Message-ID: <marc-lartc-98373940416987@msgid-missing> (raw)
<PRE>Hi to all,
Currently, my server is acting as both a web and mail server.
What I'm trying to do is to restrict the amount of relaying mail
traffics out from my server while the rest (web, ftp etc ...) still
enjoy the full bandwidth.
I'm a newbies in this traffic controlling stuffs and hope you can point
out the errors in my flags ...
Here's the tc commands I've modified from Adv-Routing-HOWTO example:-
tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit allot 1514 cell 8
avpkt 1000 mpu 64
tc class add dev eth0 parent 1: classid 1:1 cbq bandwidth 10Mbit rate 10Mbit
allot 1514 cell 8 weight 1Mbit prio 8 maxburst 20 avpkt 1000
tc class add dev eth0 parent 1:1 classid 1:2 cbq bandwidth 128Kbit rate
128Kbit allot 1514 cell 8 weight 12Kbit prio 3 maxburst 20 avpkt 1000 split
1:0 bounded
tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 10Mbit rate
10Mbit allot 1514 cell 8 weight 1Mbit prio 7 maxburst 20 avpkt 1000 split
1:0 bounded
tc filter add dev eth0 parent 1: prio 3 protocol ip u32
tc filter add dev eth0 parent 1: prio 3 u32 match tcp dst 0x0019 0xffff
match ip protocol 0x6 0xff flowid 1:2
Does the above sequences make any sense?
I believe the problem lies in the last line. I was trying to match all
outgoing traffic destined for port 25.
However, I tried sending a large attachment (abt. 1.2MB) and it reaches my
external mail server
using the full bandwidth (took abt. 30secs).
So I did a little debugging and change the last line to
tc filter add dev eth0 parent 1: prio 3 u32 match ip dst 10.0.0.0/24 flowid
1:2
( here all traffic going to my internal network get throttled )
I tried retrieving a file via http and true enough, the traffic control
works. I can only download
the file at the rate of 15.0KB/Sec (according to IE 5). 15 * 8 = 120. So I
suppose my 128Kbit
bandwidth is working perfectly.
So I think the problem lies in this command
tc filter add dev eth0 parent 1: prio 3 u32 match tcp dst 0x0019 0xffff
match ip protocol 0x6 0xff flowid 1:2
Can someone help me with my filtering rule? I tried all combination but it
just doesn't seem to work.
thanks for your attention.
cheers!
/shaoming
</PRE>
reply other threads:[~2001-02-08 10:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=marc-lartc-98373940416987@msgid-missing \
--to=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.