I am running OS X 10.10 Yosemite, and I am looking for a way to limit upload bandwidth specifically on TCP port 8333, so I can run Bitcoin Core to contribute outgoing bandwidth without completely saturating my connection.

Here is a list of utilities I have looked into:

  • ipfw - This has been deprecated since OS X 10.7, and has been removed in OSX 10.10. Unfortunately this also means that any ipfw GUIs are out too (Waterroof, Speedlimit, Noobproof, etc).

  • Network Link Conditioner - This allows bandwidth limiting on Yosemite, but only on a system-wide level. I’m looking for a solution that will limit bandwidth only on a specific port, or only for a specific app, so my entire system won’t be affected by the limit.

  • pfctl - This is the new tool that replaces ipfw in Yosemite, but there is a lot less help available online, especially on limiting port/application bandwidth.

  • dnctl - There is almost no documentation available for this online, but it seems like it may be able to do the job if configured properly. It has been mentioned before in this Stack Overflow question, but the answer doesn't provide any examples on how to use/configure dnctl to limit bandwidth.

In short, I am looking for a way to limit bandwidth of a specific application/port on OS X 10.10 Yosemite. Does anything like this exist? And if so, how can I use it to limit outgoing traffic for a specific app, or on TCP port 8333?


Here is what I've tried with pfctl and dnctl:

Maximillians-MacBook:~ Max$ sudo pfctl -E
Password:
No ALTQ support in kernel
ALTQ related functions disabled
pf enabled
Token : 1626248500898813477
Maximillians-MacBook:~ Max$ (cat /etc/pf.conf && echo "dummynet-anchor \"customRule\"" && echo "anchor \"customRule\"") | sudo pfctl -f -
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.

No ALTQ support in kernel
ALTQ related functions disabled
Maximillians-MacBook:~ Max$ echo "dummynet in quick proto tcp from any to any port 8333 pipe 1" | sudo pfctl -a customRule -f -
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.

No ALTQ support in kernel
ALTQ related functions disabled
Maximillians-MacBook:~ Max$ sudo dnctl pipe 1 config bw 10Kbit/s
Maximillians-MacBook:~ Max$ 

Unfortunately I'm still getting over 1Mbit/s chugging through my connection on port 8333.

  • Hi. Did this work for you? I tried a lot of options, read the manpages, looked here and there, but could not throttle the bandwidth on a port (29719). I was able to create my anchor, and create pipes of smaller bandwidth, but somehow could not associate a port with the pipes. – prasvin Apr 16 '16 at 8:49
  • @prasvin I haven't found a solution that's worked for me yet. – Maximillian Laumeister Apr 16 '16 at 18:51
  • In my experience, dummynet works only when no port is specified. I.e. this works: echo "dummynet out on bridge100 proto tcp from any to any allow-opts pipe 4243" | sudo pfctl -a "customRule" -f - but this does not: echo "dummynet out on bridge100 proto tcp from any to any port 80 allow-opts pipe 4243" | sudo pfctl -a "customRule" -f - – Kibber Oct 20 '17 at 2:54

For port 8333:

Create the anchor for pf to use:

(cat /etc/pf.conf && echo "dummynet-anchor \"customRule\"" && echo "anchor \"customRule\"") | sudo pfctl -f -

Create the PIPE to send the desired port to your dummynet anchor:

echo "dummynet in quick proto tcp from any to any port 8333 pipe 1" | sudo pfctl -a customRule -f -

Then set the desired speed for the pipe you created: (E.X: limit to 10mb/s)

sudo dnctl pipe 1 config bw 10Mbit/s

http://mop.koeln/blog/2015/06/01/Limiting-bandwidth-on-Mac-OS-X-yosemite/

I have been using a app called Murus, It claims to do this and much more but I have yet to get it to work on the free version for port throttling. Very powerful otherwise of a gui app.

  • The help is much appreciated, but I was unable to get it to work. Please see my updated question. – Maximillian Laumeister Jul 17 '15 at 19:06
  • It seems like this is limiting the incoming traffic, instead of the outgoing. To limit the outgoing traffic, change dummynet in ... to dummynet out .... – psmith Oct 24 '15 at 13:27
  • I was able to create my anchor, and create pipes of smaller bandwidth, but somehow could not associate a port with the pipes. It would be helpful to know the output of sudo dnctl list after running these commands. – prasvin Apr 16 '16 at 8:53

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.