На компе стоит FreeBSD 7.0 + Netams3.4.0 (3146.1)+ Squid 2.6
Netams настроил по статье Netams ч1 запустил все ок
Потом поставил squid 2.6 сделал его прозрачным и после этого трафик netams считает как то криво. Как я понял он считает щас все что на squid не попадает.
Как сделать чтобы Netams считал всеь трафик и при этом squid был прозрачным
Сервер имеет два интерфейса :
rl0 - внешний
re0 - внутренний
Вот конфиги:
netams.cfg
Код: Выделить всё
#NeTAMS version 3.3.5 (build 2916.1) compiled by gq@vice
#configuration built Thu Feb 28 09:37:18 2008
#begin
#global variables configuration
debug none
language ru
user oid 026EEA name admin real-name "Admin" crypted $1$$HpXmjtul/3i1.bf.B27bU. email root@localhost permit all
#services configuration
service server 0
login local
listen 20001
max-conn 2
service processor
lookup-delay 60
flow-lifetime 180
policy oid 0A145F name ip target proto ip
policy oid 0D59D6 name www target proto tcp port 80 81 8080 3128
policy oid 0FB46A name mail target proto tcp port 25 110
policy oid 00E42E name icq target proto tcp port 5190
policy oid 0E0BF0 name free target file /usr/local/etc/lan.txt
policy oid 0C90F6 name inet target policy-and ip !free
restrict all drop local pass
unit group oid 05D595 name CLIENTS acct-policy ip inet free www mail icq
unit host oid 0E0664 name server ip 192.168.0.1 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 0D708B name Kuzmin ip 192.168.0.10 email client1@domain.ru parent CLIENTS acct-policy ip inet free www mail icq
unit net oid 089AA5 name LAN ip 192.168.0.0 mask 255.255.255.0 acct-policy ip inet free www mail icq
unit user oid 01CB36 name Vorobjev ip 192.168.0.2 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 067407 name Morjakov ip 192.168.0.3 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 02FA98 name Maslov ip 192.168.0.4 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 0716BF name Raja ip 192.168.0.5 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 07F784 name Egkov ip 192.168.0.6 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 0CD3AA name Godovicin ip 192.168.0.7 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 0A8D65 name Buhgalterija ip 192.168.0.9 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 009D88 name Gvozdika ip 192.168.0.11 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 0999AE name Efremenkov ip 192.168.0.13 parent CLIENTS acct-policy ip inet free www mail icq
unit user oid 0524F3 name Natasha ip 192.168.0.8 parent CLIENTS acct-policy ip inet free www mail icq
#unit user oid 06B9D2 name FreeBSD ip 192.168.0.14 parent CLIENTS acct-policy ip inet free www mail icq
service storage 1
type mysql
accept all
service data-source 1
type ip-traffic
source divert 199
layer7-detect urls
service monitor 0
monitor to file /var/log/netams/mon_netams.log
monitor unit 0E0664
monitor unit 0D708B
monitor unit 01CB36
monitor unit 067407
monitor unit 02FA98
monitor unit 0716BF
monitor unit 07F784
monitor unit 0CD3AA
monitor unit 0A8D65
monitor unit 009D88
monitor unit 0999AE
monitor unit 0524F3
service quota
soft-treshold 90
delay 10
policy inet
block-policy free
set name Kuzmin policy inet active month 300M in
set name Vorobjev policy inet active month 500M in
set name Morjakov policy inet active month 500M in
set name Maslov policy inet active month 350M in
set name Raja policy inet active month 200M in
set name Egkov policy inet active month 150M in
set name Godovicin policy inet active month 250M in
set name Buhgalterija policy inet active month 100M in
set name Gvozdika policy inet active month 100M in
set name Efremenkov policy inet active month 100M in
set name Natasha policy inet active month 150M in
notify soft {owner}
notify hard {owner} 026EEA
notify return {owner}
service alerter 0
report oid 06100 name rep1 type traffic period day detail simple
smtp-server localhost
service html
path /usr/local/www/data/stat
run 5min
url http://localhost/
servlet-url
htaccess yes
client-pages all
account-pages all
service scheduler
oid 08FFFF time 5min action "html"
oid 022486 time monthly action "rotate monitor 0"
#end
ipfw
Код: Выделить всё
FwCMD="/sbin/ipfw"
LanOut="rl0"
NetOut=""
IpOut=""
LanIn="re0"
NetIn="192.168.0.0/24"
ip_lan="192.168.14"
${FwCMD} -f flush
${FwCMD} -f pipe flush
${FwCMD} -f queue flush
${FwCMD} add allow ip from any to any via lo0
${FwCMD} add deny ip from any to 127.0.0.0/8
${FwCMD} add deny ip from 127.0.0.0/8 to any
${FwCMD} add deny ip from ${NetIn} to any in via ${LanOut}
${FwCMD} add deny ip from ${NetOut} to any in via ${LanIn}
${FwCMD} add deny ip from any to 10.0.0.0/8 in via ${LanOut}
${FwCMD} add deny ip from any to 172.16.0.0/12 in via ${LanOut}
${FwCMD} add deny ip from any to 192.168.0.0/16 in via ${LanOut}
${FwCMD} add deny ip from any to 0.0.0.0/8 in via ${LanOut}
${FwCMD} add deny ip from any to 169.254.0.0/16 in via ${LanOut}
${FwCMD} add deny ip from any to 224.0.0.0/4 in via ${LanOut}
${FwCMD} add deny icmp from any to any frag
${FwCMD} add deny log icmp from any to 255.255.255.255 in via ${LanOut}
${FwCMD} add deny log icmp from any to 255.255.255.255 out via ${LanOut}
${FwCMD} add divert 199 ip from 192.168.0.0/24 to any out via ${LanOut}
${FwCMD} add fwd 192.168.0.1,3128 tcp from ${NetIn}/${NetMask} to any 80 via ${LanOut}
${FwCMD} add divert natd ip from ${NetIn}/${NetMask} to any out via ${LanOut}
${FwCMD} add divert natd ip from any to ${IpOut} in via ${LanOut}
${FwCMD} add divert 199 ip from any to 192.168.0.0/24 in via ${LanOut}
${FwCMD} add allow tcp from any to any established
${FwCMD} add allow ip from ${IpOut} to any out xmit ${LanOut}
${FwCMD} add allow udp from any 53 to any via ${LanOut}
${FwCMD} add allow udp from any to any 53 via ${LanOut}
${FwCMD} add allow udp from any to any 123 via ${LanOut}
${FwCMD} add allow icmp from any to any icmptypes 0,8,11
${FwCMD} add allow tcp from any to any via ${LanIn}
${FwCMD} add allow udp from any to any via ${LanIn}
${FwCMD} add allow icmp from any to any via ${LanIn}
${FwCMD} add deny ip from any to any