From: "Simo" <simo@mix4web.de>
To: lartc@vger.kernel.org
Subject: AW: [LARTC] PPPoE and shaping
Date: Wed, 25 Apr 2007 14:09:32 +0000 [thread overview]
Message-ID: <001a01c78743$58d71e00$0a855a00$@de> (raw)
In-Reply-To: <21dfacd30704250639t1f5623fes7c786ed8d5fceeba@mail.gmail.com>
Hi Diego,
for shaping, you can use the HTB queuing discipline in the linux traffic
control.
For the configuration you can use tc or tcng. More Informations you can find
hier: http://www.linux-ip.net/
And hier you can find a lot of configuration samples:
http://www.linux-ip.net/code/tcng/
And also in the project folder of tcng you can finde a lot of examples.
For example: i´ve used the standard ports of emule
#include "fields.tc"
#include "ports.tc"
#define UPLOAD 600kbps
dev ppp0 { /* 1Mbit */
egress {
class ( <$emule> ) if tcp_dport = 4661 || udp_dport = 4665 ||
udp_dport = 4672;
class(<$other>) if 1;
htb () {
class ( rate UPLOAD, ceil UPLOAD) {
$ssh = class ( rate 10kBps, ceil UPLOAD );
$bulk = class ( rate 520kbps, ceil UPLOAD) {sfq(perturb
10s);}
}
}
}
}
----------------------------------------------------------------------------
-----------
The tc code looks like this:
----------------------------------------------------------------------------
-----------
tc qdisc add dev ppp0 handle 1:0 root dsmark indices 4 default_index 0
tc qdisc add dev ppp0 handle 2:0 parent 1:0 htb
tc class add dev ppp0 parent 2:0 classid 2:1 htb rate 75000bps ceil 75000bps
tc class add dev ppp0 parent 2:1 classid 2:2 htb rate 10000bps ceil 75000bps
tc class add dev ppp0 parent 2:1 classid 2:3 htb rate 65000bps ceil 75000bps
tc qdisc add dev ppp0 handle 3:0 parent 2:3 sfq perturb 10
tc filter add dev ppp0 parent 2:0 protocol all prio 1 tcindex mask 0x3 shift
0
tc filter add dev ppp0 parent 2:0 protocol all prio 1 handle 2 tcindex
classid 2:3
tc filter add dev ppp0 parent 2:0 protocol all prio 1 handle 1 tcindex
classid 2:2
tc filter add dev ppp0 parent 1:0 protocol all prio 1 handle 1:0:0 u32
divisor 1
tc filter add dev ppp0 parent 1:0 protocol all prio 1 u32 match u8 0x6 0xff
at 9 offset at 0 mask 0f00 shift 6 eat link 1:0:0
tc filter add dev ppp0 parent 1:0 protocol all prio 1 handle 1:0:1 u32 ht
1:0:0 match u16 0x1235 0xffff at 2 classid 1:1
tc filter add dev ppp0 parent 1:0 protocol all prio 1 handle 2:0:0 u32
divisor 1
tc filter add dev ppp0 parent 1:0 protocol all prio 1 u32 match u8 0x11 0xff
at 9 offset at 0 mask 0f00 shift 6 eat link 2:0:0
tc filter add dev ppp0 parent 1:0 protocol all prio 1 handle 2:0:1 u32 ht
2:0:0 match u16 0x1239 0xffff at 2 classid 1:1
tc filter add dev ppp0 parent 1:0 protocol all prio 1 handle 3:0:0 u32
divisor 1
tc filter add dev ppp0 parent 1:0 protocol all prio 1 u32 match u8 0x11 0xff
at 9 offset at 0 mask 0f00 shift 6 eat link 3:0:0
tc filter add dev ppp0 parent 1:0 protocol all prio 1 handle 3:0:1 u32 ht
3:0:0 match u16 0x1240 0xffff at 2 classid 1:1
tc filter add dev ppp0 parent 1:0 protocol all prio 1 u32 match u32 0x0 0x0
at 0 classid 1:2
----------------------------------------------------------------------------
-----------------------------------------------------------------
In a world without walls who needs gates and windows?
-----Ursprüngliche Nachricht-----
Von: lartc-bounces@mailman.ds9a.nl [mailto:lartc-bounces@mailman.ds9a.nl] Im
Auftrag von Diego Giardinetto [@AMUGSiena]
Gesendet: Mittwoch, 25. April 2007 15:40
An: lartc@mailman.ds9a.nl
Betreff: [LARTC] PPPoE and shaping
Hi all,
I have a little problem with my home-made slackware linux server.
Here is the scenario:
1. I have a local wifi network
2. my server do masquerading and exit in internet via a PPPoE connection
Goals:
1. not use SQUID
2. shaping the traffic with classes
3. emule connection must have minimum priority and a band-limit of
10KBytes/s in uplink (server--->internet)
Any idea?
Thx,
Diego
--
Diego Giardinetto
Skype Name: cpuzorro
MSN: cpuoverload@hotmail.it
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
next prev parent reply other threads:[~2007-04-25 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 13:39 [LARTC] PPPoE and shaping Diego Giardinetto [@AMUGSiena]
2007-04-25 14:09 ` Simo [this message]
2007-04-25 14:58 ` AW: " Simo
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='001a01c78743$58d71e00$0a855a00$@de' \
--to=simo@mix4web.de \
--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.