I’ve followed the guide in the OpenBSD FAQs for setting up a firewall and doing port forwarding.
https://www.openbsd.org/faq/pf/example1.html https://www.openbsd.org/faq/pf/rdr.html
The reason I am attempting to do port forwarding is for online gaming. As shown in the examples, the port forward rule should come after the block all rule. However, when I follow this setup, my port forward never triggers. The port I want to forward is consistently blocked and never matches on the last rule.
My rule is
pass in on egress inet proto udp from any to any port 3074:3079 rdr-to $gamepc
But everytime I start the game, the connection is blocked on port 3075 and the game considers my NAT to be strict
Am I Missing something?
EDIT: Additional information
Following my block all rule which is currently written as block drop in log on $pubif
, I have the following rules:
pass out on { $l1 $l2 $l3 $l4 $l5 } inet keep state
This next rule is repeated for each port $l1 to $l5:
pass out on $pubif inet from $l1:network to any nat-to ($pubif)
Then
# Gaming Port Forward Begins Here
pass in on egress inet proto udp from any to any port 3074:3079 rdr-to $gamepc
pass in on egress inet proto udp from any to any port 3478 rdr-to $gamepc
pass in on egress inet proto udp from any to any port 4379:4380 rdr-to $gamepc
pass in on egress inet proto udp from any to any port 27000:27031 rdr-to $gamepc
pass in on egress inet proto udp from any to any port 27036 rdr-to $gamepc
pass in on egress inet proto tcp from any to any port 3074 rdr-to $gamepc
pass in on egress inet proto tcp from any to any port 27014:27050 rdr-to $gamepc
pass in on egress **inet** proto **udp** from any to any port 3074:3079 rdr-to $gamepc
why are you specifying inet, and are you sure you don't need any tcp rules? – caffeinatedbits Sep 24 '22 at 03:50