From owner-freebsd-net Sun Dec 16 19: 4:51 2001 Delivered-To: freebsd-net@freebsd.org Received: from harrier.prod.itd.earthlink.net (harrier.mail.pas.earthlink.net [207.217.120.12]) by hub.freebsd.org (Postfix) with ESMTP id 33A1537B41B for ; Sun, 16 Dec 2001 19:04:48 -0800 (PST) Received: from dialup-209.244.105.100.dial1.sanjose1.level3.net ([209.244.105.100] helo=blossom.cjclark.org) by harrier.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Fo55-00043v-00; Sun, 16 Dec 2001 19:04:44 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id fBH34dh15793; Sun, 16 Dec 2001 19:04:39 -0800 (PST) (envelope-from cjc) Date: Sun, 16 Dec 2001 19:04:39 -0800 From: "Crist J . Clark" To: =?iso-8859-1?Q?Boris_K=F6ster_?= Cc: freebsd-net@FreeBSD.ORG Subject: Re: nat / ipdivert problem - if possible please help Message-ID: <20011216190439.B15624@blossom.cjclark.org> References: <3C1D1186.26005.1F1D48@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <3C1D1186.26005.1F1D48@localhost>; from koester@x-itec.de on Sun, Dec 16, 2001 at 09:26:30PM +0100 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Dec 16, 2001 at 09:26:30PM +0100, Boris Köster wrote: > I have a problem. > > hope# uname -a > FreeBSD hope.hope 4.4-STABLE FreeBSD 4.4-STABLE #2: Fri Dec 14 14:59:52 CET > 2006 (???) > > I have a BSD laptop on 192.168.0.3 > > I have a BSD server 192.168.0.99 > > I have a win2k server at 192.168.0.1 > > I want to route telnet service on .99 to .3 > that means if you telnet from .1 to .99 the laptop answers on 3 > > This feature requires ipfw/natd and I have made a kernel for this (IPFIREWALL, > IPDIVERT) > > I don´t know how to continue, i tried this on the bsd server: > > /sbin/ipfw -f flush > /sbin/ipfw add divert natd all from any to any via ed0 > /sbin/ipfw add pass all from any to any > natd -interface ed0 -redirect_port tcp 192.168.0.3:telnet 192.168.0.99:telnet > > But without success. The problem I see is this, 1) The Win2k machine tries to initiate a connection to the BSD server, 192.168.0.1 -> 192.168.0.99 SYN 2) The BSD server rewrites the packet and sends its on its way, 192.168.0.1 -> 192.168.0.3 SYN 3) The BSD laptop gets the packet and sends back a response, 192.168.0.3 -> 192.168.0.1 SYN-ACK 4) The Win2k machine receives the packet, but since it hasn't tried to initiate a connection to 192.168.0.3, 192.168.0.1 -> 192.168.0.3 RST See the problem now? -- "It's always funny until someone gets hurt. Then it's hilarious." Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message