Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Bandwidth throttling and squid.

  • 07-02-2002 11:24pm
    #1
    Registered Users, Registered Users 2 Posts: 1,842 ✭✭✭


    When I'm in school, in the computer room, we all share one single channel ISDN line.. a pathetic 64k for ~25 people.

    Put simply, is there a way, with the linux server/gateway, to "reserve" a certain amount of bandwidth to be used by a certain host on the internal network?

    What I was thinking of was reserving 1k/sec of the 7 available for my BSD box in there, and let the other hotmail-checking muppets squabble over the 6k remaining. :)

    The machine has ipchains, and most of the muppets use the proxy, which is squid, I believe. Perhaps by throttling the bandwidth used by squid? (Since my box doesn't use the proxy.)

    I've googled, but didn't find much relevant information. Does anyone have any ideas?


Comments

  • Registered Users, Registered Users 2 Posts: 2,518 ✭✭✭Hecate


    hrm, dont know enough about squid to say how you could set that kind of thing up.

    But since you have a BSD box there you can configure ipfw's dummynet facilty to throttle bandwidth in both directions on specific ips, say a range of addresses that the "hotmail checking muppets" are using.

    Firstly you'd have to compile ipfw into the kernel like so:

    options IPFIREWALL
    options DUMMYNET
    options IPFIREWALL_DEFAULT_TO_ACCEPT

    That'll put it into an accept all by default stance (if you dont add that line it'll deny everything). You can then start building up some rules to curb traffic from there, thusly:

    ipfw add pipe 2 ip from any to 192.168.0.0/6
    ipfw pipe 2 config bw 6Kbit/s queue 20 mask dst-ip 0x000000ff

    That should restrict all traffic from addresses ranging from 192.168.0.0 to 192.168.0.6 to 6k a second. Obviously you can make it as low as you want for a specific person/ip whom you dont like :D

    sorry for the very BSD-centric tone there :)


  • Registered Users, Registered Users 2 Posts: 1,842 ✭✭✭phaxx


    Aah, good stuff. I see only one flaw in your suggestion - my box is bsd, and the server/gateway is linux!

    Of course, I could set the server to use my box as it's gateway, and then have my box use the um. Well that's a bit complicated and if it breaks, the admin will have my head.

    So to implement the same thing under linux?

    The nice thing about that solution is I can change it pretty much on the fly.. when I come into the room, I can run a shell script that throttles everyone else. :)


  • Closed Accounts Posts: 296 ✭✭moist


    I _believe_ that you can use "delay_pools" in squid to do this.
    I remember looking at it before, but its somewhat complicated,
    and also needs (perhaps) a squid recompile to enable it.
    (Which is why I decided to be lazy and wait for the leased line to arrive :) )

    No harm in looking at the squid.conf and seeing if you can figure it out.

    As for doing it with the linux box itself,
    try here http://ds9a.nl/lartc/HOWTO/cvs/2.4routing/output/2.4routing.html


Advertisement