From mboxrd@z Thu Jan 1 00:00:00 1970 From: sandr8_NOSPAM_@crocetta.org Date: Fri, 13 Aug 2004 17:56:22 +0000 Subject: Re: [LARTC] Shaping weirdness Message-Id: <1092419782.411d00c6bcb6f@mail.crocetta.org> List-Id: References: <70fda320408130952818c2bf@mail.gmail.com> In-Reply-To: <70fda320408130952818c2bf@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org what's your MTU size? Scrive micah milano : > I've been following the HOWTO, and reading mailing list discussions > about throttling bandwidth, and have had some success, but I just want > to tie off some loose ends. Essentially what I am wanting to do is to > keep our bandwidth usage below 1megabit, because if we go over we get > charged for that traffic. I've used some of the examples from the > HOWTO to limit our bandwidth, but I find that it gets limited to > *half* what I specify. If I specify 256, bandwidth tests (using iperf) > show that things are clamped at 128, that makes me scared that I am > doing something right. > > I'm using cbq, I've seen some people suggest using htb instead because > it is more reliable and easier to configure, but I thought i'd get > what the HOWTO says working first, and then investigate alternatives. > > I've got a machine that sits in front of the network, has the internet > plugged into eth0 and the other side plugged into eth1, and I am doing > the following: > > #!/bin/bash > LIMITDOWN%6 > LIMITUP%6 > DEV=eth0 > DEV2=eth1 > > # clean up qdiscs > tc qdisc del dev $DEV root 2> /dev/null > /dev/null > tc qdisc del dev $DEV2 root 2> /dev/null > /dev/null > > # limit up- and downlink > tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 100mbit > tc qdisc add dev $DEV2 root handle 2: cbq avpkt 1000 bandwidth 100mbit > > tc class add dev $DEV parent 1: classid 1:1 cbq rate ${LIMITDOWN}kbit \ > allot 1500 prio 5 bounded isolated > tc class add dev $DEV2 parent 2: classid 2:1 cbq rate ${LIMITDOWN}kbit \ > allot 1500 prio 5 bounded isolated > > tc class add dev $DEV parent 1: classid 1:2 cbq rate ${LIMITUP}kbit \ > allot 1500 prio 5 avpkt 1000 > tc class add dev $DEV2 parent 2: classid 2:2 cbq rate ${LIMITUP}kbit \ > allot 1500 prio 5 avpkt 1000 > > tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst \ > 0.0.0.0/0 flowid 1:1 > tc filter add dev $DEV2 parent 2: protocol ip prio 16 u32 match ip dst \ > 0.0.0.0/0 flowid 2:1 > > tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip src \ > 0.0.0.0/0 flowid 1:2 > tc filter add dev $DEV2 parent 2: protocol ip prio 16 u32 match ip src \ > 0.0.0.0/0 flowid 2:2 > > tc qdisc add dev $DEV parent 1:1 sfq perturb 10 > tc qdisc add dev $DEV parent 1:2 sfq perturb 10 > > tc qdisc add dev $DEV2 parent 2:1 sfq perturb 10 > tc qdisc add dev $DEV2 parent 2:2 sfq perturb 10 > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ > _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/