Nov 04

basndwidth-throttleAdvanced OS X users know that Darwin comes with ipfw, which can be used to set up a custom firewall. IPFW’s flexibility, very targeted bandwidth limiting rules can be made in only a few lines. This same service however can be used to also limit bandwidth on specific ports.

The following ipfw rules will limit connections from Mac to ISP’s mail server to 100K per second only for outgoing smtp connections:

sudo ipfw pipe 1 config bw 100Kbit/s
sudo ipfw pipe 1 tcp from me to smtp.west.cox.net 25

Obviously, the rate can be tailored to anything you like, and the rule is specific enough not to get in the way of any other connections going on.
to remove the pipe from the port

sudo ipfw delete 1

Another example could be for webdevelopers

You should see how long it takes modern sites to load on 56k…

Create a pipe that only allows up to 15KB/s

sudo ipfw pipe 1 config bw 15KByte/s

Attach that pipe to the outgoing traffic on port 80

sudo ipfw add 1 pipe 1 src-port 80

Delete the pipe when finished

sudo ipfw delete 1
1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Related Articles


Leave a Reply

This is website related to mac 0R windows platform?