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