From owner-freebsd-net Tue Mar 19 22:10:31 2002 Delivered-To: freebsd-net@freebsd.org Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by hub.freebsd.org (Postfix) with ESMTP id 80F7237B400 for ; Tue, 19 Mar 2002 22:10:28 -0800 (PST) Received: from blossom.cjclark.org ([12.234.91.48]) by rwcrmhc52.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020320061025.LQGT1147.rwcrmhc52.attbi.com@blossom.cjclark.org>; Wed, 20 Mar 2002 06:10:25 +0000 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.6) id g2K6AKA69528; Tue, 19 Mar 2002 22:10:20 -0800 (PST) (envelope-from cjc) Date: Tue, 19 Mar 2002 22:10:20 -0800 From: "Crist J. Clark" To: Eugene Grosbein Cc: net@FreeBSD.org Subject: Re: natd and static nat for different subnets Message-ID: <20020319221020.G67739@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <3C96CCDA.C54342F5@svzserv.kemerovo.su> <20020318225141.I60554@blossom.cjclark.org> <3C96E940.95335672@svzserv.kemerovo.su> <20020319011822.K60554@blossom.cjclark.org> <3C97043B.449715B2@svzserv.kemerovo.su> <20020319015259.M60554@blossom.cjclark.org> <3C9821BA.F44DE2E0@svzserv.kemerovo.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C9821BA.F44DE2E0@svzserv.kemerovo.su>; from eugen@svzserv.kemerovo.su on Wed, Mar 20, 2002 at 12:44:26PM +0700 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 Wed, Mar 20, 2002 at 12:44:26PM +0700, Eugene Grosbein wrote: > > I forgot point out that ipnat(8) will do this as-is if that is an > > option for you. > > Hmm, I've read man ipnat and still not sure how can I achieve > a combination of redirection ip<->ip and map net<->ip. Why not? map if0 192.168.100.0/24 -> 192.0.2.10/32 portmap tcp/udp auto map if0 192.168.100.0/24 -> 192.0.2.10/32 bimap if0 192.168.100.1/32 -> 192.0.2.10/32 map if0 172.16.0.0/16 -> 192.0.2.12/32 portmap tcp/udp auto map if0 172.16.0.0/16 -> 192.0.2.12/32 bimap if0 172.16.0.1/32 -> 192.0.2.12/32 All of the outgoing from the 192.168.100.0/24 block gets translated to 192.0.2.10. All of the incoming to 192.0.2.10 not associated with an existing connection gets passed to 192.168.100.1. The same thing goes for the 172.16.0.0/16 block except it gets translated to 192.0.2.12. Isn't that what you wanted? -- 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