Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Aug 2007 14:38:28 +1000
From:      "David N" <davidn04@gmail.com>
To:        freebsd-pf@freebsd.org
Subject:   Port Forwarding to different address
Message-ID:  <4d7dd86f0708182138x49da1b49le12461fbae2b6298@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

FreeBSD 6.2

I've been at this for an entire day and completely stumped. I'm trying
to port forward from one port number to a different port number. I
tried the normal port forwarding (same port number), that works. but
when i try different ones it doesn't work.

I know about the reflection problem, so I'm testing this via another
remote machine.

ext_if="ng0"
int_if="re0"
int_net="192.168.1.0/24"

scrub in all

nat on $ext_if from $int_net to any -> ($ext_if)

rdr on $ext_if pro to tcp from any to any port 22011 -> 192.168.1.10 port 22

pass in all
pass out all

---- Snip

I've tried it with the same port, eg.
rdr on $ext_if proto tcp from any to any port 22 -> 192.168.1.10 port 22
that works.

But with the original rule i do
ssh -p 22011 example.net
ssh: connect to host example.net port 22011: Connection refused

I've tried
rdr on $ext_if pro to tcp from any to $ext_if port 22011 -> 192.168.1.10 port 22
with no luck as well

I have
net.inet.ip.forwarding: 1

I'm not quite sure what else to do.

Regards
David N



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4d7dd86f0708182138x49da1b49le12461fbae2b6298>