Skip to content

Instantly share code, notes, and snippets.

@dokinoki
dokinoki / forwarding-example.md
Last active March 31, 2016 22:39 — forked from jinziqi/forwarding-example.md
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/dev:

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

Add the following to /etc/pf-dev.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/dev"