From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Petersen Date: Mon, 18 Oct 2004 14:28:00 +0000 Subject: Re: [LARTC] IP based bandwith limit Message-Id: <4173D2F0.1080909@peterschen.de> List-Id: References: <41738A35.9070404@peterschen.de> In-Reply-To: <41738A35.9070404@peterschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi, okay, but I think I have some problems understanding the interaction between upload and download. How I have to define my traffic classes to match upload and download depending on each other? Greets Christoph Peter Huetmannsberger wrote: >Hi > >like I said, I am new too, so take this with a grain of salt. > > > >>unfortunately there is only one interface for the customers. My problem >>is to limit the up AND down speed in dependence to each other. >> >> > >Downloads become uploads on your internal interface! > >so if eth0 is your external interface a download would be INCOMING on eth0 >but as it is going on to your internal interface (e.g. eth1) it becomes an >upload to your customer. So incoming traffic from the internet to your >customers is outgoing on eth1. > >if you do this on eth1: >-------------- >#!/bin/bash >tc qdisc add dev eth1 root handle 1: htb default 20 >tc class add dev eth1 parent 1: classid 1:1 htb rate 90mbit burst 15k >tc class add dev eth1 parent 1:1 classid 1:10 htb rate 10mbit > prio 0 burst 15k >tc class add dev eth1 parent 1:1 classid 1:20 htb rate 1mbit ceil 1mbit > burst 6k prio 1 >U32="tc filter add dev eth1 protocol ip parent 1:0 prio 0 u32" >$U32 match ip dst 192.168.1.19 flowid 1:10 >--------------- > >Then you have split the traffic into two classes: > >one for the preferred customer, who gets 10Mbit and a default for all the >other traffic, which gets 1Mbit. It still leaves a lot of bandwidth >unused! (79 Mbit) > >I have made the experience (which cost me an awful lot of time) that >assuming the interface woudl produce excactly 100Mbit is a mistake and htb >does unexpected things. It is probably bets to lower the parent class >trafic 1: to something about 10% below your actual internet connection, >even on your internal interface. (Please correct me if I am completely >wrong!) I used iptraf to have a look on the throughput. > > >You would have to do something similar for actual uploads from your >customers to the internet on eth0, but as you probably nat the traffic I >am not certain what you would do there! Anyone else? > >greetings, > >.peter > > > > > _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/