# pf and samba



## wonslung (Sep 18, 2009)

I don't know why, but it seems that when i have pf enabled on the machine with my samba server, it takes samba clients on other machines much much longer to connect.  Sometimes between 30 seconds to 2 minutes.   Is there a way to solve this issue? it's really frustrating.  Once it DOES connect, it works fine.


```
#defined services
tcp_services = "{ssh, smtp, domain, ftp, www, pop3, auth, https, pop3s, 111, 137, 138, 139, 1110, 2049, 4045, 10000, 51500 }"
udp_services = "{ domain, ftp, ntp, 111, 137, 138, 139, 1110, 1900, 2049, 4045, 51500 }"



#interface for all ip's on em0
int="re0"

#log interface

set loginterface $int

#default block rule
block log all

#allow traffic to/from localhost
pass in quick on lo0 all
pass in quick on lo1 all
pass out quick on lo0 all 
pass out quick on lo1 all

#default pass in for our defined services

pass in on $int proto tcp from any to any port $tcp_services keep state
pass in on $int proto udp from any to any port $udp_services keep state


#pass in for all torrentflux-b4rt services
pass in quick on $int proto tcp from any to any port 49160:49300 keep state

#pass in for all rtorrent ports
pass in quick on $int proto tcp from any to any port 9999:10040 keep state

# allow everything else out
pass out on $int proto tcp from any to any keep state
pass out on $int proto udp from any to any keep state
```

thanks


----------



## DutchDaemon (Sep 18, 2009)

Sounds like a typical case of DNS timeout. Your rules do contain DNS settings. Anything in a tcpdump of pflog giving a clue when a Samba connection is initiated?


----------



## wonslung (Sep 19, 2009)

I'm not sure about the dump, i've never done that, i'll check the log late night.

I GUESS i could disable pf completely on this box if i really wanted...i do run pf on my gateway as well...


(though that shouldn't have any effect on this traffic considering it's all internal)


----------

