In some email I received from Mike Holling, sie wrote:
> i've got a freebsd 4.7 box configured to do nat for our isp's dsl
> customers. the nat setup was previously running on a cisco 3640 but the
> router couldn't handle the load. now the router is connected to the
> freebsd box with a crossover cable, and the box has another ethernet card
> connecting it to the lan. for the most part this works great. under
> normal usage the box has 3000-4000 nat table entries. however sometimes a
> customer will generate a large number of entries. we have one customer
> who uses a p2p scanner that generates over 58000 nat table entries. once
> the nat table size exceeds 60000 ipnat seems to break. existing
> connections still work but new connections fail. it also takes a long
> time to execute any commands from the command line. once i'm able to
> execute ipnat -F the system works again. i read the faq and checked the
> email archives and put
>
> #define LARGE_NAT
>
> in ip_nat.h, recompiled and reinstalled ipfilter as well as a new kernel.
[...]
You might want to change NAT_TABLE_SZ from 2047 to be 80809 as well.
Actually, the #ifdef'ing for setting those needs to be reworked so
they can pickup kernel config file things even when LARGE_NAT is used.
Darren
Index: ip_nat.h
===================================================================
RCS file: /devel/CVS/IP-Filter/ip_nat.h,v
retrieving revision 2.17.2.28
diff -c -r2.17.2.28 ip_nat.h
*** ip_nat.h 2002/11/03 13:06:21 2.17.2.28
--- ip_nat.h 2003/02/08 01:35:33
***************
*** 34,59 ****
* a setup with 1000-2000 networks to NAT.
*/
#ifndef NAT_SIZE
! # define NAT_SIZE 127
#endif
#ifndef RDR_SIZE
! # define RDR_SIZE 127
#endif
#ifndef HOSTMAP_SIZE
! # define HOSTMAP_SIZE 127
#endif
#ifndef NAT_TABLE_SZ
! # define NAT_TABLE_SZ 127
! #endif
! #ifdef LARGE_NAT
! #undef NAT_SIZE
! #undef RDR_SIZE
! #undef NAT_TABLE_SZ
! #undef HOSTMAP_SIZE 127
! #define NAT_SIZE 2047
! #define RDR_SIZE 2047
! #define NAT_TABLE_SZ 16383
! #define HOSTMAP_SIZE 8191
#endif
#ifndef APR_LABELLEN
#define APR_LABELLEN 16
--- 34,65 ----
* a setup with 1000-2000 networks to NAT.
*/
#ifndef NAT_SIZE
! # ifdef LARGE_NAT
! # define NAT_SIZE 2047
! # else
! # define NAT_SIZE 127
! # endif
#endif
#ifndef RDR_SIZE
! # ifdef LARGE_NAT
! # define RDR_SIZE 2047
! # else
! # define RDR_SIZE 127
! # endif
#endif
#ifndef HOSTMAP_SIZE
! # ifdef LARGE_NAT
! # define HOSTMAP_SIZE 2047
! # else
! # define HOSTMAP_SIZE 8191
! # endif
#endif
#ifndef NAT_TABLE_SZ
! # ifdef LARGE_NAT
! # define NAT_TABLE_SZ 2047
! # else
! # define NAT_TABLE_SZ 16383
! # endif
#endif
#ifndef APR_LABELLEN
#define APR_LABELLEN 16