Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Aug 2004 11:23:32 +0200
From:      Nagilum <freebsd@nagilum.org>
To:        stan <stanb@panix.com>
Cc:        Free BSD Questions list <freebsd-questions@freebsd.org>
Subject:   Re: Can I NAT incoming connections?
Message-ID:  <41304F14.9040402@nagilum.org>
In-Reply-To: <20040827192111.GA31521@teddy.fas.com>
References:  <20040827192111.GA31521@teddy.fas.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
>
>
>  
>



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