6

I kind of expected things to break, but ...

My pf forwarding rules, which worked previously on Yosemite, no longer work on 10.11.

My forwarding rule is as follows: rdr pass on lo0 inet proto tcp from any to any port = 80 -> 127.0.0.1 port 8080

I can access the content by going to localhost:8080, but not just localhost, which is expect (and previous) behaviour.

Did they mention somewhere changes to the pf utility? What do I have to do to make this work?

6
  • Are you piping the pf rule to pfctl? If so, can you update your question to include this example.
    – Cory
    Jul 14, 2015 at 21:16
  • I encountered the same problem after upgrading to 10.11. I followed this advice to forward port 80 requests to 8080 with the following: echo "rdr pass proto tcp from any to any port {80,8080} -> 127.0.0.1 port 8080" | pfctl -a "com.apple/260.HttpFwdFirewall" -Ef Jul 17, 2015 at 18:15
  • I have the same problem... But I can't get it to work. Did you just paste this command in the terminal? I get this error: pfctl: option requires an argument -- f stackoverflow.com/questions/31517368/…
    – Dafen
    Jul 21, 2015 at 14:51
  • @Dafen the -f command requires a file. I think, if you drop that argument, the error will go away. Jul 21, 2015 at 18:21
  • ^ following the above, @williamcwilliams command does not work for me. Jul 21, 2015 at 18:22

1 Answer 1

1

This only applies to OSX 10.11 - El Capitan - Public Beta 1

In the latest 10.11 beta, 127.0.0.1 is blocked. The solution? Use 127.0.0.2. To do this:

First add 127.0.0.2 to the loopback alias sudo ifconfig lo0 alias 127.0.0.2 up

Modify your pf rule to use the the new alias. rdr pass proto tcp from any to any port 80 -> 127.0.0.2 port 8080

For @williamcwilliams (in comments above), just drop the anchor and it'll work.

echo "rdr pass proto tcp from any to any port {80,8080} -> 127.0.0.2 port 8080" | pfctl -Ef - <-- Be sure to add this last tick, you're piping in STDIN)

3
  • Why is 127.0.0.1 blocked? Jul 22, 2015 at 21:54
  • Likely a bug in the beta.
    – Cory
    Jul 23, 2015 at 21:05
  • 1
    It works again with 10.11 Beta 4 =)
    – Dafen
    Jul 24, 2015 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.