Avoiding natd overhead

Chris Bowman chris at korcett.com
Sat Oct 21 14:31:28 UTC 2006


Correction! I apologize, only noticed after I sent, obviously.  Anywhere
I typed /usr/sbin please replace with /sbin only in this case..Sorry ;)
Namely where I said /usr/sbin/natd should be /sbin/natd  ...


On Sat, 2006-10-21 at 09:23 -0500, Chris Bowman wrote:
> First, sorry for the double post, received a message saying the first
> one was rejected by a spam filter, however I now see it's on the
> list! ;)
> 
> Of course you may ask for more help!  First, take advantage of what's
> out there, people have written some absolutely great documentation,
> including the FreeBSD handbook, a reference which I have out near 24/7.
> Specifically for the problem at hand though, read up on the following :
> FreeBSD Handbook chapter 21, man make.conf , man make , and
> http://pages.silverwraith.com/papers/6/ .  
> 
> If you have the correct sources synced, refer to chapter 21 in the
> handbook again if not sure.   Then take the following out for a test
> drive.
> 
> cd /usr/src/sbin/natd
> 
> make -DCPUTYPE=pentium4  <== I happen to have a p4, insert your correct
> cpu type.
> 
> Now, make a backup of your existing natd binary, cp /usr/sbin/natd to
> the location of your choice maybe /home/username/
> 
> from /usr/src/sbin/natd now type  make install
> 
> do a ls -lah /usr/sbin/natd   you should see a new natd binary with the
> date / time you compiled it, ie recent.  
> 
> Restart natd, or start it if it's not, and see how it goes!
> 
> If something goes wrong, you can always copy your backup
> to /sbin/natd . 
> 
> 
> This should get you started, theres some more optimizing you can do, but
> I figure start here without adding to many variables to the mix.  And
> just adding the CPU type to the make flags as shown above, seems to be
> the single largest factor in making natd run as you would expect.  
> 
> Thanks!
> 
> Chris Bowman
> 
> 
> 
> 
> 
> 
> 
> On Sat, 2006-10-21 at 14:41 +0100, Spadge wrote:
> > Chris Bowman wrote:
> > >  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, 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.
> > 
> > This is pretty interesting stuff, and something I'm going to have to 
> > look into.
> > 
> > Could I be incredibly presumptious and ask you for some more info to get 
> > me started on my way?
> > 
> > Where would I start looking for info on what make flags are available 
> > for natd and my CPUs? I'm not seeing anything helpful in the README and 
> > my Makefile is very short.
> > 
> > Thanks for any help.
> > 
> > 
-- 
Chris Bowman

Vice President of Engineering

O: 512-419-7419 x202

C: 512-417-6273

F: 512-419-7680

AIM: RRTXChris

chris at korcett.com

 

www.korcett.com

 

 



More information about the freebsd-net mailing list