From owner-freebsd-isp  Sun Feb  4 16:37:44 2001
Delivered-To: freebsd-isp@freebsd.org
Received: from www.golsyd.net.au (ftp.golsyd.net.au [203.57.20.1])
	by hub.freebsd.org (Postfix) with ESMTP id BB03B37B401
	for <freebsd-isp@FreeBSD.ORG>; Sun,  4 Feb 2001 16:37:25 -0800 (PST)
Received: from [203.164.12.28] by www.quake.com.au (NTMail 4.30.0012/AB6169.63.5724aadf) with ESMTP id ebcaaaaa for <freebsd-isp@FreeBSD.ORG>; Mon, 5 Feb 2001 11:36:50 +1100
Message-ID: <3A7DF5E9.B660183B@quake.com.au>
Date: Mon, 05 Feb 2001 11:38:01 +1100
From: Kal Torak <kaltorak@quake.com.au>
X-Mailer: Mozilla 4.73 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: rch@solveinteractive.com
Cc: Jamie Heckford <heckfordj@psi-domain.co.uk>,
	freebsd-isp@FreeBSD.ORG
Subject: Re: diverting incoming packets
References: <20010204233059.D5290@freefire.trident-uk.co.uk> <20010204185845.A61368@solveinteractive.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-freebsd-isp@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.org

Robert Hough wrote:
> 
> Jamie Heckford [heckfordj@psi-domain.co.uk] wrote:
> >
> > redirect all incoming packets to port 25 from any to 192.168.0.6 port 25
> 
> ipfw add divert 25 ip from any to 192.168.0.6
> 
> This might be wrong, but sounds right. :) I would read the ipfw
> man page if I were you though, I'm sure it has the correct syntax.


It is wrong :)

Besides the fact that divert is for something else and you meant
to say fwd, but even that is wrong in this case because he said
he was using natd..

So the correct answer in this case is to do this with natd...
You could do this several ways, but the best I think is to make
a config file for natd...

In /etc/rc.conf put a line saying:

natd_flags="-config /etc/natd.conf"

Or where and what ever you want to call the config file...
Then put all the options you want in the config, each on a
new line...

To do the redirecting you want to put lines in there saying:

redirect_port tcp 192.168.0.6:25 25

If you want to redirect more than tcp traffic, just add more lines
with the protocol you want to redirect... AFAIK you cant redirect
ALL ip connection on a specific port, because ip doesnt have ports,
its the protocols above it that deal with that...

Hope this makes sense :)
Kal.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message