PF throttle bandwidth

Robert Luciani rluciani at gmail.com
Thu May 1 01:58:42 PDT 2008


Hi, with my current ISP I have a limit of 15Gb (in + out) maximum
bandwidth usage day. Sometimes a popular torrent kills this limit in an
hour and then suddenly I'm banned for 24 hours. So I set up a nifty
script to switch pf.conf files and restart pf when I near 13Gb of usage.
My question now is what can really give me a cap of 56Kb (modem speed)?
Currently I'm using

altq on $ext_if fairq bandwidth 112Kb queue { hi lo }
queue hi priority 2 bandwidth 56Kb fairq (buckets 64, default) qlimit 50
queue lo priority 1 bandwidth 56Kb fairq (buckets 64) qlimit 50

This works temporarily, sort of.. because some connections get slower,
but only because they're bursty, as opposed to really being capped to
56Kb. So does anyone know how to hard-cap a connection to a certain
speed? Doesn't even have to be pf, can be a secret magic sysctl :)

-- 
Robert Luciani





More information about the Users mailing list