Date: Tue, 10 Jul 2001 17:06:34 -0500 (CDT) From: Nick Rogness <nick@rogness.net> To: Peter Warrick <peter@guest-tek.com> Cc: freebsd-net@FreeBSD.ORG Subject: Re: IPFW and NATD Message-ID: <Pine.BSF.4.21.0107101643390.49638-100000@cody.jharris.com> In-Reply-To: <200107102003.OAA19966@mail.guest-tek.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 10 Jul 2001, Peter Warrick wrote: > I was referred to you by an Archie Cobbs who I guess did some of the > ipfw code in FreeBSD? I have a question that I'm hoping someone over > on your end might be able to help me with. I apologize if this email > has reached the wrong person btw. :) I think this belongs on freebsd-questions...but I'll answer anyway. > > I have setup a server with 2 NIC cards and have natd running on en0 > (natd -interface en0). When I execute the ipfw command.... > > ipfw add divert natd all from any to any via en0 > > everything works find and all my computers behind my server are able > to get out to the Internet. But when I try to just divert one IP on my > private network it doesn't work. I need this functionality to be able > to specify only certain machines to be nated. The command I used > was... > > ipfw add divert natd all from 192.168.1.2 to any via en0 > > 192.168.1.2 is the IP of the local machine behind my server and the IP > of en1 which this machine is connected to is 192.168.1.1 which I have > setup as my gateway on my local machine. > > Do you have any ideas why this doesn't work or what I have done wrong? > Do I need to type in another command? You need to add another rule: ipfw add divert natd all from $PUBLIC_IP to any in via en0 The $PUBLIC_IP should be the IP of en0. This will only work if your non-diverted traffic is using a different public IPs...which I'm assuming you are. Nick Rogness <nick@rogness.net> - Keep on Routing in a Free World... "FreeBSD: The Power to Serve!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0107101643390.49638-100000>