Skip to content

Instantly share code, notes, and snippets.

@Chrisell
Created June 19, 2015 16:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chrisell/06e0c2427e28f67b007e to your computer and use it in GitHub Desktop.
Save Chrisell/06e0c2427e28f67b007e to your computer and use it in GitHub Desktop.
Port forwarding 8080 -> 80 on Yosemite
# I alias this to enable_pf since it's reset on reboot
$ sudo pfctl -ef /etc/pf.conf
# /etc/pf.conf
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
rdr-anchor "forwarding"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
load anchor "forwarding" from "/etc/pf.anchors/rails"
# etc/pf.anchors/rails
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port = 80 -> 127.0.0.1 port 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment