Hi, I would like you to say me if there is something wrong with my pf configuration please.
pf.conf
Thank you
pf.conf
Code:
#Macro
ext_if = "fxp0"
int_if = "lo1"
# Tables
table <flood> persist
table <test> persist
table <tor> persist
# Rules
scrub in all
nat on $ext_if from lo1:network to any -> ($ext_if)
rdr on $ext_if proto tcp from !$ext_if:network to 192.168.1.40 port 22 -> 192.168.50.1 port 22
rdr on $ext_if proto tcp from any to 192.168.1.40 port 9001 -> 192.168.50.1 port 9001
rdr on $ext_if proto tcp from any to 192.168.1.40 port 445 -> 192.168.50.2 port 445
rdr on $ext_if proto tcp from any to 192.168.1.40 port 139 -> 192.168.50.2 port 139
rdr on $ext_if proto udp from any to 192.168.1.40 port 137 -> 192.168.50.2 port 137
rdr on $ext_if proto udp from any to 192.168.1.40 port 138 -> 192.168.50.2 port 138
#rdr on $ext_if proto {tcp, udp} from any to 192.168.1.40 port 631 -> 192.168.50.2 port 631
set skip on lo0
block all # Drop all
pass quick on $ext_if proto icmp # Allow ping
#pass in log quick on $ext_if inet proto {tcp, udp} from any to 192.168.50.2 port 631
pass in quick on $ext_if inet proto tcp from 192.168.1.29 to 192.168.1.40 port ssh
pass in log on $ext_if inet proto tcp from any to 192.168.50.1 port 22 flags S/SA keep state (max-src-conn 5, max-src-conn-rate 5/30, overload <flood> flush global)
pass in on $ext_if inet proto tcp from any to 192.168.50.1 port 9001 flags S/SA keep state (max-src-conn 1, overload <tor> )
#Samba
pass in on $ext_if inet proto tcp from any to 192.168.50.2 port {445, 139}
pass in on $ext_if inet proto udp from any to 192.168.50.2 port {137, 138}
pass out inet
block log quick on $ext_if from <flood>
block log quick on $ext_if to <flood>
block quick on $ext_if from <test>
block quick on $ext_if to <test>
Thank you
