Redirecting Traffic with PF

Scott Sipe cscotts at
Mon Feb 27 00:33:35 PST 2006

Well, I don't use PF on FreeBSD (only on OpenBSD--and am no expert by  
any means) but I would write that rule as

rdr pass on $extif inet proto udp from any to any port 27902 -> port 27902

the difference being the addition of the "pass" keyword.

IF you have a block, then allow ruleset in PF (allowing in only known  
good traffic) then you need to allow traffic on port 27902.

alternatively you could add another line

pass on any proto udp port 27902 keep state

you do NOT need to specify $intif on the rdr line.

you can also use the utility pftop (which is in the ports) tree to  
monitor livetime what's going on. Similiar to doing "pfctl -ss"


On Feb 24, 2006, at 2:13 PM, Frank Staals wrote:

> Hey,
> I have an FreeBSD server/firewall running 5-Stable with PF. I want  
> to redirect all udp traffic on port 27902 from the internet to a  
> computer in my network. I used this rule but I have some problem  
> with it: sometimes connections on that port are refused and I can't  
> connect with other players ( it's for a online game ) :
> rdr on $extif inet proto udp from any port 27902 ->  
> port 27902
> I think the problem might have something to do with the different  
> network interfaces since the traffic is comming in on $extif and  
> has to go to an computer connected to $intif ? And how can I do  
> that ? Can I change it to:
> rdr on $extif inet proto udp from any port 27902 -> $intif  
> port 27902
> ? Or what do I have to do to fix it.
> Thanks in advance,
> -- 
> -Frank Staals
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions- 
> unsubscribe at"

More information about the freebsd-questions mailing list