From: nix4me <nix4me@cfl.rr.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Simple traffic shaping
Date: Tue, 12 Jul 2005 00:53:38 +0000 [thread overview]
Message-ID: <42D31492.1010206@cfl.rr.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0507111937090.18851@andretta.apf.it>
Barbara M. wrote:
>
> My needs is limiting the outbound traffic of an smtp mail server.
> It is connected to a gateway via 100Mbit ethernet. I want limits its
> outbound traffic to max 3 Mbit.
>
> I have read lot of docs and tried various script without great results.
>
> Any simplest solutions?
>
> TIA.
> Regards, B.
>
>
>
> _______________________________________________
> LARTC mailing list
> LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
>
You should be able to mark all the smtp packets with iptables and then
shape them with tc. There are examples of marking and the shaping
commands in the docs.
For reference, this is how i mark and shape ftp traffic. You will need
something similar. I mark ftp traffic by port and then shape.
iptables -t mangle -N MYSHAPER-OUT
iptables -t mangle -I OUTPUT -o eth0 -j MYSHAPER-OUT
iptables -t mangle -A MYSHAPER-OUT -m mark --mark 0 -j MARK --set-mark 20
iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 59999 -j MARK
--set-mark 26
iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 50000:51000 -j MARK
--set-mark 26
iptables -t mangle -A MYSHAPER-OUT -p tcp -m length --length :64 -j MARK
--set-mark 20
# clear it
tc qdisc del dev eth0 root
#add the root qdisk
tc qdisc add dev eth0 root handle 1: htb default 20
#add main rate limit class
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit
#add leaf classes
tc class add dev eth0 parent 1:1 classid 1:26 htb rate 40kbps
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100mbit
#filter traffic into classes
tc filter add dev eth0 parent 1:0 prio 0 protocol ip handle 20 fw
flowid 1:20
tc filter add dev eth0 parent 1:0 prio 0 protocol ip handle 26 fw
flowid 1:26
Mark
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
next prev parent reply other threads:[~2005-07-12 0:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-11 17:41 [LARTC] Simple traffic shaping Barbara M.
2005-07-11 17:47 ` ICI Support
2005-07-11 22:45 ` Barbara M.
2005-07-12 0:53 ` nix4me [this message]
2005-07-12 3:25 ` gypsy
2005-07-12 11:59 ` Barbara M.
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=42D31492.1010206@cfl.rr.com \
--to=nix4me@cfl.rr.com \
--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.