"Wolfgang Draxinger" <(E-Mail Removed)> wrote in
message news:gmekfk$p5f$(E-Mail Removed)...
> Hi there,
>
> I'd like to adjust the bandwidth avaliable for traffic from/to a specific
> subnet. Well, actually, I'd like to limit the bandwith for all traffic
> _except_ the traffic originating in the local subnet.
>
> Background information: The hoster where I've got my server located
provides
> a free 1TB/month traffic volume into the internet. ATM I'm far from even
> touching 10% of that, but still I'd like take precautions. Local traffic,
> e.g. between servers in the data center, or to the provided backup
storage
> is unlimited though, so I'd like to not limit that.
>
> There's however only one network interface, and so far I've read into
> the "tc" manpages traffic control seems possible for the whole interface
> only; but I may have missed something there.
Not true. You haven't read it carefully.
Example: Limit GoogleBot to 1Mbit/sec.
tc qdisc add dev eth0 root handle 1:0 htb default 20
tc class add dev eth0 parent 1:0 classid 1:1 htb prio 1 rate 1Mbps
tc filter add dev eth0 parent 1:0 prio 1 protocol ip u32 match ip dst
66.249.64.0/19 match ip sport 80 0xFFFF flowid 1:1
This actually limits ALL fetches from Google's network for web pages (port
80) to a maximum of 1Mbit/s. If these three statements were the only
rules, then everything else would be unlimited.
> The iptables limit module however works on whole packets, so this is
packet
> limiting, not bandwidth limiting. That's not what I want.
There is still some anti-abuse [connection] limiting that should probably
be done.
> The best idea I had so far was somehow making eth0 into distinct
interfaces
> for local and internet traffic, adjusting the routing tables
apropriately.
> But then I had no idea, how to do that without coding a small program
> creating a couple of tap interfaces, replicating the data to a master tap
> which is bridged with eth0 and putting the traffic control on the slave
> taps. I regard that idea as kinda like Frankenstein and would not like to
> do it that way.
>
> There must be a better one. Though I got no clue in which direction to
look.
|