Can I NAT incoming connections?

Nagilum freebsd at nagilum.org
Sat Aug 28 02:23:52 PDT 2004


Hi Stan,
if you use ipnat to do the NAT you need something like that in your 
ipnat.conf:

   rdr tun0 0/0 port 2000-2010 -> 192.168.1.20 port 2000

This would redirect the ports 2000-2010 on your gateway to the same 
ports on the machine 192.168.1.20 in your LAN.
If you use pf it's pretty much the same:

  rdr on $ext_if port 2000-2010 -> 192.168.1.20 port 2000

check the proper man pages (ipnat.conf(5), pf.conf(5)) for the details.
I hope this helps,
kind regards,
Alex.

stan wrote:

>I've set up a ppp conection (tuneled over ssh and socks) from a machine on
>the home network to a mcahine at work. At home, where I have control of the
>rotueing tables, I've set up routes to allow all amchines to use this
>link to access the machine at work.
>
>However, I want more :-). I want to be able to access the rest of the
>machiens at work. To do this the packest leaving the machine at work will
>need to be NAT'ed to look like the originate _from_ that machine, and
>unNAT'ed on the way out.
>
>Is this possible?
>
>If so, can anyone point me in the direction of some documentation as to how
>to get it working? Both machines are (of course) FreeBSD machines.
>
>
>  
>



More information about the freebsd-questions mailing list