From owner-freebsd-questions Sun Apr 15 12:21: 3 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cody.jharris.com (cody.jharris.com [205.238.128.83]) by hub.freebsd.org (Postfix) with ESMTP id 28E3A37B422 for ; Sun, 15 Apr 2001 12:21:01 -0700 (PDT) (envelope-from nick@rogness.net) Received: from localhost (nick@localhost) by cody.jharris.com (8.11.1/8.9.3) with ESMTP id f3FKR9l63292; Sun, 15 Apr 2001 15:27:09 -0500 (CDT) (envelope-from nick@rogness.net) Date: Sun, 15 Apr 2001 15:27:08 -0500 (CDT) From: Nick Rogness X-Sender: nick@cody.jharris.com To: Andrei Cojocaru Cc: freebsd-questions@FreeBSD.ORG Subject: Re: IPFW Rules (Port Forwarding) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 15 Apr 2001, Andrei Cojocaru wrote: > I am trying to forward all packets destined to 216.126.10.210:80 (outside IP > of multi-homed host) to 192.168.0.4:80 > > this is the IPFW rule I made: > > ipfw add 30 fwd192.168.0.4,80 tcp from any to 216.126.10.210 80 > > but I get an error when I try to add it I get this error: > ipfw: getsockopt(IP_FW_ADD): Invalid argument You need to compile the kernel with 'options IPFIREWALL_FORWARD'. However, as you will see, this will not work the way you think. You should not be using ipfw fwd to do this. This is a job for natd. You are *changing* the actual src,dst address in the packets. Natd allows you to do that...ipfw fwd does not. Nick Rogness - Keep on Routing in a Free World... "FreeBSD: The Power to Serve!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message