On 20 Oct 2006 04:11:17 -0700,
(E-Mail Removed) wrote:
>hello,
>i am investigating the possibility of having a linux box do traffic
>shaping between a lan and a router for the internet. the aim is to
>distribute fairly the limited bandwidth towards the internet among all
>the hosts connected to the lan.
>is it conceivable to create a tc rule for each ip in the lan? for
>instance having a htb as a root and a child class or qdisc for each
>host in the network?
Yes.
>say the lan has 100 hosts, what kind of pc would be required to suit
>this task (ram, cpu speed)?
A Pentium 4 at 800 or an AMD at 1000 is plenty, RAM needs to be 256.
>would this large set of rules lead to an unmanageable overhead in the
>kernel?
No. A thousand IPs gets to be in the realm of 3+ Gig CPUs and a gig
or 2 of RAM, but 100 is not a problem. Tens of thousands of rules
requires hashes.
>are there any better ways to distribute bandwidth among a number of
>hosts?
The probability is that your internal IPs are NATted and so you will
have trouble writing a script that can distinguish between the
computers. The LARTC mailing list has lots of stuff about that, so I
strongly recommend that you spend some time reading it.
One of the search words you should use is cafe Another might be hotel
Assuming the machines on our LAN are NATted, you should also use NAT
as a keyworrd in searches.
I don't know how to spell it, but look at shurdix.
One bee for your bonnet: What you propose is a bit difficult becase
not everyone is using the connection at the same time. Give some
thought to allocating the bandwidth fairly between the actual users,
not the IPs that might/could use it.
The (protentially) best solution is to use iptables to mark packets to
internet ports (20, 21, 22, 25, 53, 80, 110, 443, Etc.) and then match
the marks in your shaping filters.
Tip: Almost everything in iproute2 is in hex even though hardly
anthing says "0xblah", Don't think in decimal and specify the x for
clarity.
>thank you a lot.
>jacopo
--
buck