Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm doing some usability testing of a web application and am attempting to debug and record some SSL sessions using mitmproxy as a transparent proxy and for some reason pf under Mac OS X Mountain Lion isn't setting up the transparent redirects.

First, I enable forwarding:

sudo sysctl -w net.inet.ip.forwarding=1

Next, I create a simple pf.conf file with a single line on it:

rdr on {en1, en0} inet proto tcp to any port {80, 443} -> port 3128

Where the is the remote host that is currently running mitmproxy and en1 and en2 are the main outgoing interfaces on the Mac.

Finally, I start up pf with the following commands:

sudo pfctl -vf pf.conf
sudo pfctl -e

However, nothing happens. When I list the currently running rules for pf with pfctl -sr it doesn't show anything.

I've confirmed that pf can work on the machine by giving it a dummy rule which blocks all outbound access to port 80 and that works.

Any hints about what else I need to do to enable pf to redirect web traffic to a transparent proxy on Mac OS X Mountain Lion?

share|improve this question
I had the same issue. Have a look at the answer written by Dan on this ServerFault question: serverfault.com/questions/421261/… –  Cam Jul 24 '13 at 0:43
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.