Open port with pfctl in OS X El Capitan - Allow incoming connections from Internet

3

1

I was struggling with a kind of configuration that I'm doing with my mac mini. I have set my machine on the DMZ of my network, so any request to my public ip will end on this machine.

The problem is that I can't get anything from the internet is the Firewall is enabled, I tried with this configuration with PFCTL :

rdr pass on lo0 inet proto tcp from any to any port = 8080 -> 127.0.0.1 port 8080
rdr pass on en0 inet proto tcp from any to 192.168.1.100 port = 8080 -> localhost port 8080
#rdr pass on en0 inet proto tcp to port 8080 -> 127.0.0.1 port 8080

rdr pass on en0 inet proto tcp from any to any port = 5000 -> localhost port 5000

#rdr pass on en0 inet proto tcp from any to any port 8080 -> 127.0.0.1 port 8080

#rdr pass on en0 inet proto tcp from any to 192.168.1.100 port = 8080 -> 127.0.0.1 port 8080
#rdr pass on lo0 inet proto tcp from any to 192.168.1.100 port = 8080 -> 127.0.0.1 port 8080

This works locally ,

curl http://localhost:8080 
curl http://127.0.0.1:8080

This also works if the FIREWALL is not enabled :

curl http://mypublicip:8080

But If I just enable my firewall , the same request does not work anymore, resulting in a time out.

Does someone was able to solve this ? Could you help me please ?

Thanks

Daniel Flores

Posted 2015-12-10T09:17:21.667

Reputation: 131

No answers