From owner-freebsd-net@FreeBSD.ORG Sat Oct 21 13:38:27 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B96616A403 for ; Sat, 21 Oct 2006 13:38:27 +0000 (UTC) (envelope-from daiyon.fbsd@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id E949E43D4C for ; Sat, 21 Oct 2006 13:38:26 +0000 (GMT) (envelope-from daiyon.fbsd@gmail.com) Received: by nf-out-0910.google.com with SMTP id p77so1754172nfc for ; Sat, 21 Oct 2006 06:38:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=McrkLZroE8LLKWafVJaFTj5d6PpKxH04x0vCroPLkOuRMTzlZGCr/Nrr15k3cIXxzl5zKwQN32xLp2ZEWbCQJE+fqx63YJYjCx4ilFv86eu+zG+p8+Akys6n3mOvCtdfU0tA+5+h9a4c8trnml3XE0KGCmxU1Q4XzGztZZ0msfs= Received: by 10.78.178.5 with SMTP id a5mr3854291huf; Sat, 21 Oct 2006 06:38:25 -0700 (PDT) Received: by 10.78.139.13 with HTTP; Sat, 21 Oct 2006 06:38:25 -0700 (PDT) Message-ID: Date: Sat, 21 Oct 2006 08:38:25 -0500 From: "Chris Bowman" To: net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Avoiding natd overhead X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2006 13:38:27 -0000 I see this question come up now and then on the lists, so, I'll share what I've learned about natd and performance! First, if your running natd on a processor which supports more functions than just a standard 386, ie a Pentium, Athlon, etc. Then I've found compiling natd with make flags for that processor, and with O3 optimizations will make your jaw drop in comparison to the default installed version of natd. You can find if you have the sources downloaded for FreeBSD the natd source in /usr/src/sbin/natd , just recompile natd itself, copy the new binary you compile to wherever your current natd binary is installed, /sbin/natd likely. just recompile natd itself, or when you re-build world for your system, make sure you have make flags set in make.conf so everything will rebuild with optimized flags, however I don't recomend O3 at all for a build world, will almost definately break something, for natd itself, it works fine. Just to note, make sure if you only recompile natd itself, and don't rebuild world, that you download sources for the version which you are currently running, nothing newer. That's about it! Very simple, but I think it's often overlooked, and of course there are a few variables with NAT and performance, number of hosts, number of connections each host is using simulataneously (Torrents *cough). You don't want to overload NATd itself, 65535 TCP, UDP ports, keep that in mind. If your doing nat for a large number of hosts, break down your ip range into sections and run natd multiple times to help balance the load. Thanks! Chris Bowman