From owner-freebsd-questions Tue May 12 12:08:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA03149 for freebsd-questions-outgoing; Tue, 12 May 1998 12:08:32 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA03125 for ; Tue, 12 May 1998 12:08:19 -0700 (PDT) (envelope-from andre.albsmeier@mchp.siemens.de) Received: from salomon.mchp.siemens.de (salomon.siemens.de [139.23.33.13]) by david.siemens.de (8.8.8/8.8.8) with ESMTP id VAA10017 for ; Tue, 12 May 1998 21:07:49 +0200 (MDT) X-Envelope-Sender-Is: andre.albsmeier@mchp.siemens.de (at relayer david.siemens.de) Received: from curry.mchp.siemens.de (daemon@curry.mchp.siemens.de [146.180.31.23]) by salomon.mchp.siemens.de (8.8.8/8.8.5) with ESMTP id VAA16948 for ; Tue, 12 May 1998 21:07:48 +0200 (MDT) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.8.8/8.8.8) id VAA06210 for ; Tue, 12 May 1998 21:07:50 +0200 (CEST) From: Andre Albsmeier Message-Id: <199805121907.VAA22807@internal> Subject: Re: Can this be done with natd in -STABLE? In-Reply-To: from Doug White at "May 12, 98 11:02:44 am" To: dwhite@resnet.uoregon.edu Date: Tue, 12 May 1998 21:07:42 +0200 (CEST) Cc: andre.albsmeier@mchp.siemens.de, freebsd-questions@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Tue, 12 May 1998, Andre Albsmeier wrote: > > > > > I would like to change a connection request made to host1:port1 > > > > to another host2:port2 instead. Is this possible with natd? > > > > I have experimented a little bit but I only get it conncted > > > > to host2:port1... > > > > > > Yes, you have to set up redirections. Of course you'll never be able to > > > reach host2:port1 once you set it up. It's detailed on the natd man page. > > > > That would mean that I have to redirect host1 to host2 and port1 to > > port2, right. I didn't find that in the natd man page... Also, if > > host2:port1 can't be reached anymore, that would be a problem here. > > Hm, I found it easily: > > -redirect_port linkspec > > Redirect incoming connections arriving to given port to > another host and port. Linkspec is of the form > > proto targetIP:targetPORT [aliasIP:]aliasPORT [re- > moteIP[:remotePORT]] > > I could be wrong about the host2:port1 thing. I think I am... Maybe it's > host1:port1? Yes, I found that one also. However, I am not sure how to set it up correctly: Assuming natd is running on nathost on port "natd 4665/divert" and I want to redirect tcp connections going to host1:port1 in real to host2:port2. host2 is connected to fxp0. First the ipfw statment: ipfw add divert natd all from any to any via fxp0 Or do I have to use ipfw add divert natd all any to host1 via fxp0 And the the natd line: natd -n fxp0 -redirect_port tcp host2:port2 host1:port1 I have tried around a little bit and I see packets going through natd (when run with -v), but the connection never succeeds... Any hints? Thanks, -Andre To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message