Aug 012012
 

Sometimes it is necessary to throttle the throughput of a specific service like AFP or HTTP.┬áThis is possible with the help of ipfw‘s pipe feature on Mac OS X.

The following example slows the in- and outgoing AFP traffic down to 100KByte/s.

ipfw pipe 1 config bw 100KByte/s # configure the speed limit
ipfw add 1 pipe 1 src-port 548 # monitor out-
ipfw add 2 pipe 1 dst-port 548 # ... and incoming traffic

It is also possible to only slow down some hosts. To do that the rules have to be adapted. This example throttles only AFP traffic from and to the host 192.168.0.10.

ipfw pipe 1 config bw 100KByte/s
ipfw add 1 pipe 1 ip from any to 192.168.0.10 src-port 548
ipfw add 2 pipe 1 ip from 192.168.0.10 to any dst-port 548

PS: To reset a (possible broken) ruleset use the flush command

ipfw flush

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)