[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pf rule confusion

On Wed, Dec 18, 2002 at 09:26:47AM -0800, Bryan Irvine wrote:
> I have an openbsd (3.1) natted firewall, with 3 nic's
> rl0 =
> sis =
> ep1 = (it's being used as an internal address don't ask,
> long irritating story)
> i'm trying to set it up to 
> A> act as a gateway for both the 192.233.103.* and 192.168.0.* networks,
> while allowing me to forward any requests for 192.233.100.* to a
> different router.
That should be covered with something like
  nat on rl0 from to any ->
  nat on rl0 from to any ->
> B> Allow me to port forward vnc ports to allow remote external
> connections via vnc in.  I have it partially setup now.  I have it so
> that it will act as a gateway for the 192.168.0.* network and will allow
> vnc traffic to that network, but, it will not let me forward to the
> 192.233.103 network.  I assume it's because it's not actually natting
> this interface.
That's done with
  rdr on rl0 from any to port 5900 \
     -> port 5900
There's several reasons why the redirection might not work.
a) Verify that you can ping from the firewall.
b) Verify that you can ping the external host from the firewall.
c) Verify that you can ping the external host from
If that works, it's probably not a routing problem.
d) Make sure you allow incoming connections to port 5900
   on rl0. Yes, since translation happens before filtering, the packets
   will have destination address (not when
   they're filtered.
If it still doesn't work, you'll have to explain more specifically how
'it does't work'. tcpdump on rl0 and ep1, do you see the initial TCP SYN
packet arrive on rl0, and does it go out through ep1 with the translated
destination address? Does it arrive at the vnc server? Does the server
send a SYN ACK back? Does the reply reach ep1 on the firewall? Does it
get sent out through rl0 with the source address properly translated
back to the external address?