Re: Newb question: tc shedulers on 2 interfaces

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 28 December 2004 18:46, Patrich Björklund wrote:
> Hi all! I'm new to this list, and hope for some clarity in this matter:
>
> I have a home-gateway with linux-2.6.9 and iproute2 (ver:2.6.9). My
> following tc syntaxes.
>
> # eth0 internet scheduleing are:
>
> tc qdisc add dev eth0 root handle 1: htb default 20
>
> tc class add dev eth0 parent 1: classid 1:1 htb rate 512kbit burst 6k
> tc class add dev eth0 parent 1:1 classid 1:10 htb rate 512kbit burst 6k
> prio 1
> tc class add dev eth0 parent 1:1 classid 1:20 htb reate 9*512/10kbit
> burst 6k prio 2
>
> tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
>
> tc filter add dev eth0 parent 1:0 protocol ip prio 10 u32 match ip tos
> 0x10 0xff flowid 1:10
> tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \
> match ip protocol 6 0xff \
> match u8 0x50 0x0f at 0 \
> match u16 0x0000 0xffc0 at 2 \
> match u8 0x10 0xff at 33 \
> flowid 1:10
>
> tc qdisc add dev dev eth0 handle ffff: ingress
>
> tc filter add dev eth0 parent ffff: protocol ip prio 50 u32 \
> match ip src 0.0.0.0/0 police rate 2200kbit burst 10k drop flowid :1
>
> # My eth1 schedule:
> tc qdisc add dev eth1 root tbf rate 512kbit latency 50ms burst 10000
>
> The long eth0 tc-script is fetched externally as you may see...but:
>
> This have worked well for me (no, really) but...since I am a newbee, I
> have read the lartc doc, and understood some but very much was really
> hard to get...especially the class and filter stuff. Lets say it's not a
> 'for dummies' book :) No complainig. My Q are, is there a chance I will
> get packet losses or other messes to gateway(eth1/eth0) if I have no
> rule set for my LAN-PC:s? Or the above scripts for that matter...Should
> I have a 'eth1 tc-command here?' Or any advice or comment would be
> greatly appreciated.
There are no real errors in your script.  Of course, each script can be tuned.  
Some remarks:
- you are only shaping traffic leaving eth0, if you add class/filters to eth1, 
you can also shaping traffic leaving eth1
- you are shaping traffic leaving eth1 because you are shaping traffic 
entering eth0 with the ingress qdisc.  but using htb/cbq for shaping gives 
you much more control.
- try http://docum.org/ for other/more  information.

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


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux