View Single Post
  #1   (View Single Post)  
Old 2nd October 2021
epitaxial epitaxial is offline
Port Guard
 
Join Date: Feb 2015
Posts: 21
Default Anyone have a working pf redirect rule?

I've been trying for hours now to redirect a port on my external wan ip to an internal machine. I've tried various combinations of

Code:
rdr on $ext_if proto udp from any to $ext_if port 32400 -> 192.168.1.32 port 32400
and

Code:
rdr on $ext_if proto tcp from any to any port 32400 -> 192.168.1.32
But nothing seems to work!

Here is the whole pf.conf

Code:
# Set some variables for use later
ext_if="em0"
int_if="ix0"
icmp_types="echoreq"

# Skip all loopback traffic
set skip on lo

# Scrub all traffic
scrub in

# Perform NAT on external interface
#rdr on $ext_if proto udp from any to $ext_if port 32400 -> 192.168.1.32 port 32400
nat on $ext_if from $int_if:network -> ($ext_if:0)
rdr on $ext_if proto tcp from any to any port 32400 -> 192.168.1.32



# Define default behavior
block in
pass out keep state

# Allow inbound traffic on internal interface
pass quick on $int_if

# Protect against spoofing
antispoof quick for { lo $int_if }

# Allow other traffic
pass in on $ext_if proto tcp to ($ext_if) port 32400 flags S/SA keep state
What am I doing wrong?
Reply With Quote