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