redsocks icon indicating copy to clipboard operation
redsocks copied to clipboard

pf firewall setting on MacOs X

Open bkolobara opened this issue 9 years ago • 3 comments

Hi,

I'm trying to set up redsocks on my mac machine. I got it running, but I'm not sure how to configure pf to redirect traffic to it. With iptables I can do:

iptables -t nat -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345

But with pf I'm not sure. This is one configuration I found:

match out on en0 from any to 10.0.0.0/8 nat-to 127.0.0.1

I only want to route traffic for 10.0.0.0/8 through redsocks. I never found an option to specify the port .

And I'm also interested in learning more how redsocks works internally? If all traffic goes to one port how can it know where to forward the connection? Does the request to 127.0.0.1:12345 still contain the original headers?

bkolobara avatar Jul 25 '15 18:07 bkolobara

I never solved this problem, but if somebody finds this googling take also a look here: http://serverfault.com/questions/709369/pf-mac-os-x-rule-to-redirect-all-traffic-to-a-specific-ip-port/746983#=

Maybe this additional information will be useful to you.

bkolobara avatar Jan 06 '16 16:01 bkolobara

how to config redirector for pf??

tony1016 avatar Jan 14 '16 05:01 tony1016

I have no permanent root access to machines running MacOSX to test and develop for this platform. If was v0.4 ever working on MacOSX, please, contribute documentation with working MacOSX firewall configuration guidelines.

darkk avatar Feb 01 '18 19:02 darkk