Subject: Re: Problems with pf(4)'s rdr rules
To: Dave Huang <khym@azeotrope.org>
From: Joseph A. Dacuma <jadacuma@ched.gov.ph>
List: netbsd-help
Date: 11/24/2005 13:21:19
Hi Dave!

> I'm trying to use pf(4) to NAT my LAN to a single public IP address,
> and redirect incoming UDP packets on a certain port to an internal
> machine. However, it's not working reliably... packets from one IP
> address are redirected properly, but not packets from another. I have
> no idea what the difference would be...
>
> I've trimmed down my pf.conf to:
>
> ext_if="rtk0"
> int_if="fxp0"
>
> nat on $ext_if from !($ext_if) -> ($ext_if:0)
>
> rdr pass on $ext_if proto tcp to port 25 -> 10.1.1.73 port 25
> rdr pass on $ext_if proto tcp to port 80 -> 10.1.1.71 port 80
>
> rdr pass on $ext_if proto udp from any to any port 2093:2096 -> 10.1.1.11
> port 2093:*
>

Have you tried not specifying "port 2093:*" for your udp redirection? You
can try not stating port numbers at the end of your udp rdr as your are
not trying to redirect udp traffic to another port for host 10.1.1.11. For
example:

rdr on $ext_if proto udp from any to any port 2093:2096 -> 10.1.1.11

HTH.

Joseph