From owner-freebsd-questions@FreeBSD.ORG Fri Nov 30 14:59:40 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45A916A417 for ; Fri, 30 Nov 2007 14:59:40 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.227]) by mx1.freebsd.org (Postfix) with ESMTP id 7B91913C4DD for ; Fri, 30 Nov 2007 14:59:40 +0000 (UTC) (envelope-from usleepless@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so1717252nzf for ; Fri, 30 Nov 2007 06:59:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=xu/bDaHdtU2vLhE1qrvtu3tlXVBEpnSTECb/b5ZC07Y=; b=uFCmtUDVPFdEl9JNNdXc2dPeW3qXAchwiy7Bl85IrzSHIXe1tgz9dhbWuO2gUXE5sUV3hRaKdjNfL7w6peIOfGxcnaT3BBydd23OGy3LEd0RgnnEdlxvqn81xVzBoPwnyQPrMFAL/4/YifOB6ngLBi3woCIlF33wXUFw89U3xiE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JRMS5/6crDwdCjCmNMhKMjhNBhRGG0HJvKrwtRO1QlbfUzlVNdT82jqUe0rlk02eY7Ber8nb95jEbSEd/+eYgBB5j9s8ok3SQHriJ4l7wQ4UpBcQxqR8fqktI9meBIkeiJVhWL1+vQWpEtoVOttTQaXbuNbh4ucNdHXhrnKvYOY= Received: by 10.142.222.21 with SMTP id u21mr159636wfg.1196433217179; Fri, 30 Nov 2007 06:33:37 -0800 (PST) Received: by 10.142.178.14 with HTTP; Fri, 30 Nov 2007 06:33:37 -0800 (PST) Message-ID: Date: Fri, 30 Nov 2007 15:33:37 +0100 From: usleepless@gmail.com To: "Lucas Neves Martins" In-Reply-To: <49eaeb190711300559u34557d6bha38a72d84a65caca@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <49eaeb190711300559u34557d6bha38a72d84a65caca@mail.gmail.com> Cc: questions@freebsd.org Subject: Re: Firewall Redirect X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2007 14:59:40 -0000 On 11/30/07, Lucas Neves Martins wrote: > Hello guys, > > I=B4m having the following problem: > > Redirect requests from the port 80, to the port 8082. - for apache tomcat= . > > I=B4m new on freeBSD, Of course, I had looked out on google, and read the > firewall section on the Handbook. > > But only found missed things, and nothing worked. > > I have tried this commands: > > #history | grep divert > > H > > > > 422 ipfw add 950 divert 8082 tcp from any to any 80 via em0 > 425 ipfw add 950 divert 8082 tcp from any to any 80 via em0 > 428 ipfw add 950 divert 80 tcp from any to any 8082 via em0 > 432 ipfw add 950 divert 8082 tcp from any to any 80 via em0 > 435 ipfw add 950 divert 8082 tcp from any to any 80 via em0 > > > > I know how works the number 950, I know it is on the right position, but = I > dont know how works the divert, > > and even what it is. I dont know if "divert 8082" makes the requests come > from 80, or go to 80. > > damn... > > Any help will be useful. AFAIK, divert in ipfw diverts to unix-domain sockets. i think you might pull it off with ipnat + /etc/ipnat.conf: rdr em0 0.0.0.0/0 port 80 -> 0.0.0.0/0 port 8082 regards, usleep