Проблемы с ipnat. Все время растет значение inuse:
ipnat -s | grep inuse
1787 inuse in
1993 inuse out
И это всего при работающих 7 машинах (без торрентов!) через этот шлюз, активных сессий:
ipnat -s | grep active
142 active
Ночью число активных сессий вообще не более 10, но при этом значения inuse значительно не уменьшаются. Специально прождал 2 выходных и наблюдал, значения inuse так же сильно не уменьшились.
Параллельно использую шлюз на Freebsd 7.2 в котором старый ipnat, на нем работают более 30 машин... вот что на нем:
ipnat -s
mapped in 475029329 out 621161921
added 13356530 expired 13319116
no memory 0 bad nat 8405
inuse 2518
Ночью значение inuse на этом шлюзе падает меньше 100...
Настройки таймаутов ipfilter у обоих шлюзов одинаковые и имеют значения по умолчанию.
Если не перегружать ipnat на FreeBSD 10.1, то через неделю другую параметр inuse вырастает до заоблачного значения более 60000, и понятно что начинаются жуткие лаги при соединении.
Выкладываю с FreeBSD 10.1 ipf -T list
ipf_flags min 0 max 4294967295 current 0
active min 0 max 0 current 0
control_forwarding min 0 max 1 current 0
update_ipid min 0 max 1 current 0
chksrc min 0 max 1 current 0
min_ttl min 0 max 1 current 4
icmp_minfragmtu min 0 max 1 current 68
default_pass min 0 max 4294967295 current 134217730
tcp_idle_timeout min 1 max 2147483647 current 864000
tcp_close_wait min 1 max 2147483647 current 480
tcp_last_ack min 1 max 2147483647 current 60
tcp_timeout min 1 max 2147483647 current 480
tcp_syn_sent min 1 max 2147483647 current 480
tcp_syn_received min 1 max 2147483647 current 480
tcp_closed min 1 max 2147483647 current 60
tcp_half_closed min 1 max 2147483647 current 14400
tcp_time_wait min 1 max 2147483647 current 480
udp_timeout min 1 max 2147483647 current 240
udp_ack_timeout min 1 max 2147483647 current 24
icmp_timeout min 1 max 2147483647 current 120
icmp_ack_timeout min 1 max 2147483647 current 12
ip_timeout min 1 max 2147483647 current 120
ipf_flags min 0 max 4294967295 current 0
active min 0 max 0 current 0
control_forwarding min 0 max 1 current 0
update_ipid min 0 max 1 current 0
chksrc min 0 max 1 current 0
min_ttl min 0 max 1 current 4
icmp_minfragmtu min 0 max 1 current 68
default_pass min 0 max 4294967295 current 134217730
tcp_idle_timeout min 1 max 2147483647 current 864000
tcp_close_wait min 1 max 2147483647 current 480
tcp_last_ack min 1 max 2147483647 current 60
tcp_timeout min 1 max 2147483647 current 480
tcp_syn_sent min 1 max 2147483647 current 480
tcp_syn_received min 1 max 2147483647 current 480
tcp_closed min 1 max 2147483647 current 60
tcp_half_closed min 1 max 2147483647 current 14400
tcp_time_wait min 1 max 2147483647 current 480
udp_timeout min 1 max 2147483647 current 240
udp_ack_timeout min 1 max 2147483647 current 24
icmp_timeout min 1 max 2147483647 current 120
icmp_ack_timeout min 1 max 2147483647 current 12
ip_timeout min 1 max 2147483647 current 120
log_suppress min 0 max 1 current 1
log_all min 0 max 1 current 0
log_size min 0 max 524288 current 32768
state_max min 1 max 2147483647 current 4013
state_size min 1 max 2147483647 current 5737
state_lock min 0 max 1 current 0
state_maxbucket min 1 max 2147483647 current 26
state_logging min 0 max 1 current 1
state_wm_high min 2 max 100 current 99
state_wm_low min 1 max 99 current 90
state_wm_freq min 2 max 999999 current 20
nat_lock min 0 max 1 current 0
nat_table_size min 1 max 2147483647 current 2047
nat_table_max min 1 max 2147483647 current 30000
nat_rules_size min 1 max 2147483647 current 127
rdr_rules_size min 1 max 2147483647 current 127
hostmap_size min 1 max 2147483647 current 2047
nat_maxbucket min 1 max 2147483647 current 22
nat_logging min 0 max 1 current 1
nat_doflush min 0 max 1 current 0
nat_table_wm_low min 1 max 99 current 90
nat_table_wm_high min 2 max 100 current 99
proxy_debug min 0 max 31 current 0
ftp_debug min 0 max 127 current 0
ftp_pasvonly min 0 max 1 current 0
ftp_insecure min 0 max 1 current 0
ftp_pasvrdr min 0 max 1 current 0
ftp_forcepasv min 0 max 1 current 1
ftp_single_xfer min 0 max 1 current 0
tftp_read_only min 0 max 1 current 1
ftp_debug min 0 max 127 current 0
ftp_pasvonly min 0 max 1 current 0
ftp_insecure min 0 max 1 current 0
ftp_pasvrdr min 0 max 1 current 0
ftp_forcepasv min 0 max 1 current 1
ftp_single_xfer min 0 max 1 current 0
И еще мне не понятно почему 2 раза выводятся значения одних и тех же параметров? На старом ipnat (Freebsd 7.2) такого нет.
ipnat.conf:
map em0 192.168.0.0/24 -> xxx/32 proxy port ftp ftp/tcp
map em0 192.168.0.0/24 -> xxx/32 portmap tcp/udp 20000:25000
#Redirect SSLPOP
rdr em0 from any to xxx/32 port = 995 -> 192.168.0.1 port 995
rdr ste0 from any to xxx1/32 port = 995 -> 192.168.0.1 port 995
#Redirect VOIP
rdr em0 from any to xxx/32 port = 5060 -> 192.168.0.114 port 5060
rdr ste0 from any to xxx1/32 port = 5060 -> 192.168.0.114 port 5060
#
ipf.conf:
pass out quick on em0 proto tcp/udp from 192.168.0.0/24 to any keep state
block in quick on em0 from any to 192.168.0.0/24
#
rc.conf:
#IPNAT
tcp_drop_synfin="YES"
icmp_drop_redirect="YES"
icmp_log_redirect="NO"
ipfilter_enable="YES"
ipnat_enable="YES"
ipfilter_rules="/etc/ipf.rules"
ipnat_rules="/etc/ipnat.rules"
Ipnat работает на уровне ядра.
Вот не пойму, что нужно сделать чтобы не забивалась таблица соединений (inuse)?