On Tue, Jan 4, 2011 at 2:33 PM, Michael Spratt <m...@magicislandtechnologies.com> wrote: > Dear friends, linux/ipfw/dummynet/transparent-bridge, am trying to cap > users to upload/TX rates, but allow them to go over if the link is not > congested. > > The example below limits each src-ip mask-IP's TX from 10.10.0.0/20 to > 128Kbp/s, and from 10.20.0.0/20 to 1024Kbp/s. > ------------------------------------------------------------------------------------- > ipfw pipe 1 config bw 128Kbit/s mask src-ip 0xffffffff > ipfw pipe 2 config bw 1024Kbit/s mask src-ip 0xffffffff
Create 1 pipe of "1024+128" Kbps. Then create 2 queues, one with weight 1 (the slow queue) and the other with weight 8 (the fast queue). That will guarantee that traffic sent through queue 1 gets at least 128 Kbps of bandwidth, even when the pipe is full. And traffic sent through queue 2 gets at least 1024 Kbps of bandwidth, even when the pipe is full. The beauty of queues, though, is that either queue can "expand" to fill the full pipe, if there's no traffic in the other queues. Thus, queue 1 is guaranteed 128 Kbps of bandwidth, but can use up to the full pipe worth if queue 2 is empty. And queue 2 is guaranteed 1024 Kbps of bandwidth, but can use up to the full pipe worth if queue 1 is empty. > ipfw 10001 add pipe 1 ip from 10.10.0.0/20 to any out xmit br0 > ipfw 10001 add pipe 2 ip from 10.20.0.0/20 to any out xmit br0 Then, change the above rules to use the queues instead. The way dummynet works, is that pipes set hard limits on the bandwidth. And queues provide minimum guarantees for bandwidth inside of that pipe. -- Freddie Cash fjwc...@gmail.com _______________________________________________ freebsd-ipfw@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw To unsubscribe, send any mail to "freebsd-ipfw-unsubscr...@freebsd.org"