Maximum Static NAT sessions under FreeBSD

Brandon Gooch jamesbrandongooch at
Mon Feb 15 01:56:16 UTC 2010

On Sun, Feb 14, 2010 at 5:18 PM,  <cio at> wrote:
>   Hello,
>   I was wondering if anyone could t ell me what is the maximum number
>   of static IP NAT sessions FreeBSD can sup port and what are the
>   limiting factors (memory, bus speed, software release , forks, etc)?
>   Kind regards,
>   < div>
>   David Bennett

I'm statically NAT-ting 1024 addresses using the in-kernel NAT via
ipfw. I increased NAT_BUF_LEN in sys/netinet/ip_fw.h from 1024 to
65536 to accommodate the number of rules.

Performance is good; I'm also using dummynet to throttle bandwidth for
each IP. I don't know enough about FreeBSD's internals to give you
info on performance or limiting factors, although I suppose you want a
reasonably powerful CPU (especially if you're using dummynet), but
memory doesn't seem to be a problem:

last pid: 42109;  load averages:  0.97,  0.98,  0.84   up 163+06:11:06 20:33:51
32 processes:  1 running, 31 sleeping
CPU:  0.2% user,  0.0% nice, 50.4% system, 21.6% interrupt, 27.8% idle
Mem: 45M Active, 662M Inact, 203M Wired, 5152K Cache, 111M Buf, 81M Free
Swap: 2048M Total, 2048M Free

It's on a 45 Mbit DS3 (symmetric). The top(1) output above is at about
10 Mbits Rx and 6 Mbits Tx on the box.


More information about the freebsd-questions mailing list