Mac – How to add a ipfw forward rule to little snitch

firewallmacNetwork

I use the following rules to connect to my nginx server on a vagrant machine:

sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to me 80
sudo ipfw add 100 fwd 127.0.0.1,8090 tcp from any to me 443

after installing little snitch, it seems to have made ipfw useless and i can't figure out how to apply a forward rule to little snitch?

Best Answer

Since ipfw is also removed in Yosemite the solution is to use pf

create a file in /etc/pf.anchors/

e.g. com.myapp

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080

NOTE: Add a trailing line break. Otherwise pf will say you have a syntax error.

edit /etc/pf.conf add right after rdr-anchor "com.apple/*":

rdr-anchor "myapp"

and after load anchor "com.apple" from "/etc/pf.anchors/com.apple":

load anchor "myap" from "/etc/pf.anchors/com.myapp"

NOTE: Add a trailing line break. Otherwise pf will say you have a syntax error.

Next, reload the rules into pf by running sudo pfctl -f /etc/pf.conf

Finally, enable pf by running sudo pfctl -e

Source: https://github.com/basecamp/pow/issues/452