I am working on a test project that requires me to block https access for a specific app on my Mac (OS X 10.9).

The instruction provided are "Chinese" to me and I have no idea where to start:

(Example: Alter the iptables)

  1. Block the port:

    root@QA9:/opt/appname/appnamerouter2# iptables --list
    root@QA9:/opt/appname/appnamerouter2# iptables -A INPUT -p tcp --destination-port 443/8443 -j DROP
    root@QA9:/opt/appname/appnamerouter2# iptables --list
  2. For Open the Port:

    root@QA9:/opt/appname/appnamerouter2# iptables -D INPUT 1

Maybe editing your host file could help. You can find some help here about editing host files:


Little Snitch is proprietary, the open source software I use for this is 'gas mask' :


  • Editing host file won't selectively block the ssl ports and leave the other ports open. That might be sufficient for the testing needs, but I would guess they wouldn't have identified iptables to block specific ports if a broader / easier to accomplish block was feasible. – bmike Nov 29 '13 at 20:59

It is not an answer in regards of the commands you have but a quick solution/workaround might be Little Snitch which doesn't force you to learn the terminal commands - but does need a little work to learn how to engage it selectively.

It's a graphical tool which makes some people much more comfortable when configuring an application firewall. It also comes with great support and several nice guides for getting started.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .