All of lore.kernel.org
 help / color / mirror / Atom feed
From: "GoMi" <gomiuk@hotmail.com>
To: lartc@vger.kernel.org
Subject: RE: [LARTC] Lots amounts of classes to solve the DAP problem
Date: Wed, 23 Apr 2003 12:45:31 +0000	[thread overview]
Message-ID: <marc-lartc-105110208418128@msgid-missing> (raw)
In-Reply-To: <marc-lartc-105103510025149@msgid-missing>

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have finally worked a solution for egress traffic, but now i am a bit troubled with ingress with IMQ due to SNAT
Here is my script, i have tried lots of combinations but with IMQ, the filters do not filter to the classes at all. 
I am pretty sure its because of the SNAT i am doing. Any one nows how to work around this problem?

I attach the script:

UPLINK00
DEV=eth2 
IDEV=imq1 
IQDEV=1

tc qdisc add dev $DEV root handle 1:0 htb default 766
tc class add dev $DEV parent 1:0 classid 1:1 htb rate 300kbit ceil 300kbit

tc qdisc add dev ${IDEV} handle 1: root htb default 766
tc class add dev ${IDEV} parent 1: classid 1:1 htb rate 1900kbit ceil 1900kbit

echo "Qdisc primario 1:1 [OK]"

for ((a=2;a<766;a=a+3))
do
   tc class add dev $DEV parent 1:1 classid 1:$a htb rate 2kbit ceil 300kbit
   tc class add dev ${IDEV} parent 1:1 classid 1:$a htb rate 2kbit ceil 1900kbit

done

for ((a=2,b=3;a<766;a=a+3,b=b+3))
do
   tc class add dev $DEV parent 1:$a classid 1:$b htb rate 1kbit ceil 300kbit
   tc qdisc add dev $DEV parent 1:$b handle $b: pfifo

   tc class add dev ${IDEV} parent 1:$a classid 1:$b htb rate 1kbit ceil 1900kbit
   tc qdisc add dev ${IDEV} parent 1:$b handle $b: pfifo

done
echo "Clases interactivas y Qdiscs [OK]"

for ((a=2,b=4;a<766;a=a+3,b=b+3))
do
   tc class add dev $DEV parent 1:$a classid 1:$b htb rate 1kbit ceil 300kbit
   tc qdisc add dev $DEV parent 1:$b handle $b: sfq perturb 10

   tc class add dev ${IDEV} parent 1:$a classid 1:$b htb rate 1kbit ceil 1900kbit
   tc qdisc add dev ${IDEV} parent 1:$b handle $b: sfq perturb 10

done
echo "Clases no-interactivas y Qdiscs [OK]"

for ((a=2,b=3,c=4;a<256;a++,b=b+3,c=c+3))
 do
  iptables -t mangle -A FORWARD -s 192.168.2.$a -i eth3 -p icmp -j MARK --set-mark $b
  iptables -t mangle -A FORWARD -s 192.168.2.$a -i eth3 -p tcp --dport :1024 -j MARK --set-mark $b
  iptables -t mangle -A FORWARD -s 192.168.2.$a -i eth3 -p tcp --dport 1024: -j MARK --set-mark $c
  iptables -t mangle -A FORWARD -s 192.168.2.$a -i eth3 -p udp --dport :1024 -j MARK --set-mark $b
  iptables -t mangle -A FORWARD -s 192.168.2.$a -i eth3 -p udp --dport 1024: -j MARK --set-mark $c

  iptables -t mangle -A PREROUTING -d 192.168.2.$a -p icmp -j MARK --set-mark $b
  iptables -t mangle -A PREROUTING -d 192.168.2.$a -p tcp --sport :1024 -j MARK --set-mark $b
  iptables -t mangle -A PREROUTING -d 192.168.2.$a -p tcp --sport 1024: -j MARK --set-mark $c
  iptables -t mangle -A PREROUTING -d 192.168.2.$a -p udp --sport :1024 -j MARK --set-mark $b
  iptables -t mangle -A PREROUTING -d 192.168.2.$a -p udp --sport 1024: -j MARK --set-mark $c

  tc filter add dev $DEV protocol ip parent 1:0 handle $b fw flowid 1:$b
  tc filter add dev $DEV protocol ip parent 1:0 handle $c fw flowid 1:$c

  tc filter add dev $IDEV protocol ip parent 1:0 handle $b fw flowid 1:$b
  tc filter add dev $IDEV protocol ip parent 1:0 handle $c fw flowid 1:$c

done
echo "MANGLE y FILTROS [OK]" DEV=eth0

iptables -t mangle -A POSTROUTING -o eth3 -j IMQ --todev ${IQDEV}

ip link set ${IDEV} up
ip link set ${DEV} txqueue 30


- -----Mensaje original-----
De: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl] En nombre de Stef Coene
Enviado el: martes, 22 de abril de 2003 21:06
Para: GoMi
CC: lartc@mailman.ds9a.nl
Asunto: Re: [LARTC] Lots amounts of classes to solve the DAP problem


On Tuesday 22 April 2003 20:58, GoMi wrote:
> Because i want each IP to differ from interctive traffic and the rest. 
> I have to change the ceil cuantity so they can get the full bw. I dont 
> get what you say about the root qdisc, i forgot to add to the script 
> tc qdisc add dev $DEV root handle 1: htb :)
I mean this :

1:
  1:1 with rate = ceil = link bandwidth
     1:2 IP1
     1:3 IP2
     etc

Stef

- -- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

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

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPqaK637diNnrrZKsEQI0LgCgwVy/IzJ8JYiSRbfKNGLf8kXMIhwAoPae
nzZ18637z02Pedi4NXSleWNg
=GbCa
-----END PGP SIGNATURE-----
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2003-04-23 12:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 18:10 [LARTC] Lots amounts of classes to solve the DAP problem GoMi
2003-04-22 18:52 ` Stef Coene
2003-04-22 18:58 ` GoMi
2003-04-22 19:06 ` Stef Coene
2003-04-23 12:45 ` GoMi [this message]
2003-04-23 20:28 ` Stef Coene
2003-04-23 21:05 ` GoMi
2003-04-24 14:12 ` GoMi
2003-04-25 20:53 ` Stef Coene
2003-04-26  3:39 ` Rio Martin.
2003-04-26  4:50 ` Paul Evans
2003-04-26  8:01 ` 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=marc-lartc-105110208418128@msgid-missing \
    --to=gomiuk@hotmail.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.