2

I have a server running on my iMac (port 8000) and I want my iPad to be able to visit it through the local network so I set this rule using pf anchors (hence ipfw is gone).

It doesn't work, what am I missing?

file: /etc/pf.anchors/com.test

rdr pass on lo0 inet proto tcp from any to 192.168.2.2 port 80 -> 127.0.0.1 port 8000
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 8000 -> 127.0.0.1 port 8000

enable the command:

pfctl -ef /etc/pf.anchors/com.test

Visiting my iMac's IP-address from the iPad 192.168.1.1 gives me an unreachable message (Safari)

From my iMac all seems OK:

# nc -v 192.168.2.2 80
found 0 associations
found 1 connections:
     1: flags=82<CONNECTED,PREFERRED>
    outif lo0
    src 127.0.0.1 port 52342
    dst 127.0.0.1 port 5001
    rank info not available
    TCP aux info available

Connection to 192.168.2.2 port 80 [tcp/http] succeeded!

# curl -I 192.168.2.2
HTTP/1.0 302 FOUND
Date: Wed, 25 Feb 2015 10:39:47 GMT
Server: WSGIServer/0.1 Python/2.7.6
Vary: Cookie
Content-Type: text/html; charset=utf-8
Location: http://192.168.2.2/
1

Try using this command:

echo "rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8000" | sudo pfctl -ef -

That command should forward your port 80 to port 8000. I got that from this website http://salferrarello.com/mac-pfctl-port-forwarding/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .