mercredi 11 février 2015

PF Port forwarding not working


I have the following rule in a file in /etc/pf.anchors/



rdr pass on lo0 inet proto {udp,tcp} from any to self port 25 -> 127.0.0.1 port 1025


The intention is to forward all local traffic to port 25 onto port 1025, this is so sent emails can be captured before they are sent for testing email delivery on websites locally.


I then have added rdr-anchor "foo" and load anchor "foo" from "/etc/pf.anchors/foo" into /etc/pf.conf.


When I run pfctl -v -n -f /etc/pf.conf I get the following:



Loading anchor foo from /etc/pf.anchors/foo
rdr pass on lo0 inet proto udp from any to 127.0.0.1 port = 25 -> 127.0.0.1 port 1025
rdr pass on lo0 inet proto udp from any to 10.0.1.3 port = 25 -> 127.0.0.1 port 1025
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port = 25 -> 127.0.0.1 port 1025
rdr pass on lo0 inet proto tcp from any to 10.0.1.3 port = 25 -> 127.0.0.1 port 1025


So it looks as if it should be working, however if I run an nmap scan on the port it says closed, or if I send a test email with echo "This is the body of a text test-mail" | mail -s "Email test" test@test.com the email is not caught, but also doesn't seem to get sent.


The most strange thing is that I have pretty much the same configuration for pf on my work mac and the forwarding works fine.


Any ideas would be great as I don't even really know how to debug this issue.





Aucun commentaire:

Enregistrer un commentaire