Skip to content

Instantly share code, notes, and snippets.

@varmais
Created October 22, 2014 07:16
Show Gist options
  • Save varmais/ccbc236242960239f5de to your computer and use it in GitHub Desktop.
Save varmais/ccbc236242960239f5de to your computer and use it in GitHub Desktop.
# Port forward 80 to 8080 in OS X Yosemite
# Add this line to /etc/pf.anchors/<anchor name>
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 8080
# Save and test if it has any errors
$ sudo pfctl -vnf /etc/pf.anchors/<anchor name>
# Add these lines to /etc/pf.conf
rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/<anchor name>"
# Save and load the config
$ sudo pfctl -ef /etc/pf.anchors/<anchor name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment