Skip to content

Instantly share code, notes, and snippets.

@josephwinston
Forked from ryanzhou/pf.md
Created July 25, 2014 23:57
Show Gist options
  • Save josephwinston/c4b585dae1ce3e54d994 to your computer and use it in GitHub Desktop.
Save josephwinston/c4b585dae1ce3e54d994 to your computer and use it in GitHub Desktop.

Getting Pow to work in OS X Yosemite

Some parts taken from: https://gist.github.com/kujohn/7209628

ipfw is officially deprecated and removed in OS X Yosemite. Pow requires another program pf to handle the port forwarding.

1. Anchor file

Create file /etc/pf.anchors/pow

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

2. Reference anchor in pf.conf

Insert rdr-anchor "pow" and load anchor "pow" from "/etc/pf.anchors/pow" at correct places in /etc/pf.conf, so that it looks like this:

scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
rdr-anchor "pow"  # Pow port forwarding
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
load anchor "pow" from "/etc/pf.anchors/pow"  # Pow port forwarding

3. Enabling pf

You can enable pf manually via sudo pfctl -ef /etc/pf.conf

However, to enable pf automatically after every boot, save the following as /System/Library/LaunchDaemons/com.apple.pfctl.plist:

<key>ProgramArguments</key>
<array>
<string>pfctl</string>
<string>-e</string>
<string>-f</string>
<string>/etc/pf.conf</string>
</array>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment