Либо я что-то не понимаю, либо.....

Технические вопросы по UTM 5.0
Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Либо я что-то не понимаю, либо.....

Сообщение nops »

Суть проблемы:
CentOS 5.2(полная установка, собрал почти всё)
Ставлю UTM5 - поставилась. запускаю - запустилась.
настроил маломальски.
а статистику не собирает.
тех.поддержка советуют стовить ng_netflow, ndsad. Но они только под фри.
Ещё нюанс.
Статистика собирается, но как-то криво и не правильно, может я что напутал?
Трафик считает в несколько раз меньший, нежели на самом деле(без указанных коллекторов). При чём, выводит информацию о трафике ТОЛЬКО после перезагрузки utm5_core.

Пример:
Залажу в инет, качаю 10 метров трафика. через часок залажу в админку и гляжу трафик - пусто! Перезагружаю UTM5_CORE - счастье, статистика появилась, но трабла, трафик раз в 10-15 меньше реального.

Конфигурация сети:
Одна машина, CentOs 5.2, настроен NAT по средству iptables. правила прописаны на пропускание трафика для клиентов.
iptables -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 80.х.х.х
Тыт же UTM5.
другими словами всё поднял на одной машине.

Заранее спасибо за помощь.

mikkey finn
Сообщения: 1612
Зарегистрирован: Пт ноя 10, 2006 15:23

Сообщение mikkey finn »

google: ipcad

Аватара пользователя
detx
Сообщения: 346
Зарегистрирован: Вт мар 11, 2008 12:00
Откуда: Нижний Новгород

Re: Либо я что-то не понимаю, либо.....

Сообщение detx »

nops писал(а):Суть проблемы:
CentOS 5.2(полная установка, собрал почти всё)
Ставлю UTM5 - поставилась. запускаю - запустилась.
настроил маломальски.
а статистику не собирает.
тех.поддержка советуют стовить ng_netflow, ndsad. Но они только под фри.
Ещё нюанс.
Статистика собирается, но как-то криво и не правильно, может я что напутал?
Трафик считает в несколько раз меньший, нежели на самом деле(без указанных коллекторов). При чём, выводит информацию о трафике ТОЛЬКО после перезагрузки utm5_core.

Пример:
Залажу в инет, качаю 10 метров трафика. через часок залажу в админку и гляжу трафик - пусто! Перезагружаю UTM5_CORE - счастье, статистика появилась, но трабла, трафик раз в 10-15 меньше реального.

Конфигурация сети:
Одна машина, CentOs 5.2, настроен NAT по средству iptables. правила прописаны на пропускание трафика для клиентов.
iptables -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 80.х.х.х
Тыт же UTM5.
другими словами всё поднял на одной машине.

Заранее спасибо за помощь.
))) :D

Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Сообщение nops »

Вот нет чтобы подсказать, в чём трабла......
mikkey finn писал(а):google: ipcad
спасибо! Т.е.
Я должен поставить ipcad, настроить его и он будет работать вместо ndsad, ng_netflow.... Так?
Тогда можно ещё вопрос.
У меня прописано в iptables пропускать всех в инет, каким образом в UTM отключать пользователей от инета при минусовом балансе? А так же ограничивать скорость?

Спасибо.

Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Сообщение nops »

Ещё такой вопрос!
У меня установлена libpcap, и при ./configure выдаёт "Unable to determine packet source type! Install at least libpcap!
"
Это значит что у меня типа не стоит libpcap. Проверяю:

Код: Выделить всё

[root@novour ipcad-3.7.3]# yum list libpcap
Installed Packages
libpcap.i386                             14:0.9.4-12.el5        installed
[root@novour ipcad-3.7.3]#
вот и что делать дальше?

Libpcap стоит, но компилятор его не видит.

Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Сообщение nops »

всё, спасибки, поставил. Теперь нужно с самого нуля настроить. Дело в том, что я сейчас пока тестирую, перед тем, как поставить на рабочий шлюз, т.е. шлюз сейчас и так работает на локалку, только пользователи уведомлены что инет будет отваливаться.
сейчас я всё это дело буду ставить на RAID и потом запускать.
Можете по русски описать какой модуль за что отвечает, как настраивать фаервол и так далее.
Можно даже написать статью, думаю не мне одному это полезно будет.

Спасибо.

P.S. Статья для настройки ipcad

Аватара пользователя
ds
Сообщения: 380
Зарегистрирован: Пн сен 18, 2006 14:06

Сообщение ds »

nops писал(а):Ещё такой вопрос!
У меня установлена libpcap, и при ./configure выдаёт "Unable to determine packet source type! Install at least libpcap!
"
Это значит что у меня типа не стоит libpcap. Проверяю:

Код: Выделить всё

[root@novour ipcad-3.7.3]# yum list libpcap
Installed Packages
libpcap.i386                             14:0.9.4-12.el5        installed
[root@novour ipcad-3.7.3]#
вот и что делать дальше?

Libpcap стоит, но компилятор его не видит.
yum install libpcap-devel :) для начала

Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Сообщение nops »

ds писал(а):
nops писал(а):Ещё такой вопрос!
У меня установлена libpcap, и при ./configure выдаёт "Unable to determine packet source type! Install at least libpcap!
"
Это значит что у меня типа не стоит libpcap. Проверяю:

Код: Выделить всё

[root@novour ipcad-3.7.3]# yum list libpcap
Installed Packages
libpcap.i386                             14:0.9.4-12.el5        installed
[root@novour ipcad-3.7.3]#
вот и что делать дальше?

Libpcap стоит, но компилятор его не видит.
yum install libpcap-devel :) для начала
Спасибо за совет, до этого уже дошёл.
Настроил utm5 по мануалу (стр.101)
запустил utm5_core start
далее запустил ipcad скриптом /usr/local/bin/ipcad -rds
в инет пользователи выходять по средству iptables, прописано правило, разрешающее пользователю из локалки выходить в инет.
но это пока бог с ним, а вот траыик для этого пользователя не считает.... Вообще всё пусто, детальная статистика в том же числе.

gil
Сообщения: 355
Зарегистрирован: Вт ноя 11, 2008 14:28

Сообщение gil »

лучше бы сделал, как на аватарке.. freebsd+ng_netflow+pf..

gil
Сообщения: 355
Зарегистрирован: Вт ноя 11, 2008 14:28

Сообщение gil »

лучше бы сделал, как на аватарке.. freebsd+mpd/ng_netflow(в зависимости от способа выхода в инет)+pf..

(случайно продублировал, вместо редактирования, сори)

mikkey finn
Сообщения: 1612
Зарегистрирован: Пт ноя 10, 2006 15:23

Сообщение mikkey finn »

на той аватарке он видимо в пассивной позе, а в активной - начальство. или даже тот же линух

Аватара пользователя
Chris
Сообщения: 2323
Зарегистрирован: Чт июн 02, 2005 14:08
Откуда: 33 76 77 71 86 37 98

Сообщение Chris »

Пассивный ))))) Эх...

Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Сообщение nops »

Ду уж. Смешно и в то же время грустно!!!
Да нет, можно рассуждать по разному, можно помтавить и туда и сюда...
Надо мной нет начальства, просто до этого я использовал шлюз Ideco + лекарство, а сейчас они там намудрили в нём, и если используешь какой-либо кейген, система вся рушится в течении нескольких дней.
Вот я и решил сам поднять шлюз.
У меня своя небольшая локальная сеть. И биллинг необходим, т.к. люди разные, одним я доверяю, а другим просто не могу доверить, к тому же, речь идёт о деньгах.
Вообщем, я попробовал фрю, но так ничего сделать и не смог, как-то тяжоловата для меня эта ОСя, поэтому остановился на лине. Сначала был ASPLinux, но он, цука, какой-то кривой, а нормально работать не хотел, поэтому, посоветовшись, почитав в инете я сделал выбор в пользу CentOS.
И с правилами всё нормально, заработали сразу, и хостинг.....

Но вот сейчас стоит проблема с биллинговой системой. У моего прова тоже стоит UTM5, но они, во-аервых: поставили на FreeBSD, а во-вторых: они отказываются делиться советами.
Я попробовал поговорить с админами, они даже разговаривать не хотят, отправляют на сайт разработчика и говорят типа:"там всё написано".
Так-то оно так, но многое не понятно. Учитывая что я новичёк в *NIX подобных системах, я не много понял, поэтому и прошу помощи.

Сейчас стоит проблема.
iptables:

Код: Выделить всё

# Generated by iptables-save v1.2.7a on Thu Nov 20 23:44:08 2003
*nat
:PREROUTING ACCEPT [0:0]
#:PREROUTING ACCEPT [15:1651]
#-I PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
#-I PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp --dport 488 -j REDIRECT --to-ports 3128
#-I PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp --dport 591 -j REDIRECT --to-ports 3128
#-I PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp --dport 77 -j REDIRECT --to-ports 3128
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 80.х.х.х
COMMIT
# Completed on Thu Nov 20 23:44:08 2003
# Generated by iptables-save v1.2.7a on Thu Nov 20 23:44:08 2003
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
:DIRECTLINK - [0:0]
#ssh
-A INPUT -i eth0 -p tcp --dport 22 -s 192.168.0.0/255.255.255.0 -j ACCEPT
#http
-A INPUT -i eth0 -d 80.х.х.х -p tcp --dport 80 -j ACCEPT
-A OUTPUT -o eth0 -s 80.х.х.х -p tcp --sport 80 -j ACCEPT
#dns
-A INPUT -i eth0 -d 80.х.х.х -p udp --dport 53 -j ACCEPT
-A OUTPUT -o eth0 -s 80.х.х.х -p udp --sport 53 -j ACCEPT
#
-A INPUT -i eth1 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,ACK SYN -j REJECT --reject-with icmp-port-unreachable
-A INPUT -s 127.0.0.1 -i lo -j ACCEPT
-A INPUT -s 80.х.х.х -i lo -j ACCEPT
-A INPUT -s 192.168.0.1 -i lo -j ACCEPT
-A INPUT -d 80.х.х.х -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -d 80.х.х.х -p icmp -j ACCEPT
-A FORWARD -j DIRECTLINK
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-net-unreachable
-A OUTPUT -s 127.0.0.1 -j ACCEPT
-A OUTPUT -s 80.х.х.х -j ACCEPT
-A OUTPUT -s 192.168.0.1 -j ACCEPT
-A DIRECTLINK -s 192.168.0.0/255.255.255.0 -p tcp --dport 21 -j DROP
-A DIRECTLINK -s 192.168.0.0/255.255.255.0 -j ACCEPT
COMMIT
# Completed on Thu Nov 20 23:44:08 2003
Поставил "Stargazer"- ну это типа биллинговая система, но мне она просто считает трафик, так, для контроля её поставил
Поставил UTM5, она встала, запустилась, Поставил libpcap+libpcap-devel, установил ipcad, запускаю как демона с ключами

Код: Выделить всё

/usr/local/bin/ipcad -rds
из файла

Код: Выделить всё

/etc/rc.d/rc.local
всё запускается, нормально, ну всё как в мануале по utm на стр.101, далее написано, прокачайте трафик на тестируемую машину и проверьте, я прокачал порядка гиктара, проверяю "трафик" и "детальный трафик" - ТИШИНА, вообще пусто, Вот в чём трабла даже и не знаю.

Может я что напутал в конфиге? может ещё что. Подскажите как что сделать...

Аватара пользователя
detx
Сообщения: 346
Зарегистрирован: Вт мар 11, 2008 12:00
Откуда: Нижний Новгород

Сообщение detx »

ipcad.conf покажи????

Аватара пользователя
nops
Сообщения: 48
Зарегистрирован: Пн фев 09, 2009 13:05

Сообщение nops »

detx писал(а):ipcad.conf покажи????
показываю, настраивал с помощью СТАТЬИ

Код: Выделить всё

#
# Configuration file for ipcad - Cisco IP accounting simulator daemon.
# Copyright (c) 2001, 2002, 2003, 2004, 2005
# 	Lev Walkin <vlm@lionet.info>.
#
# Please see ipcad.conf&#40;5&#41; for additional explanations.
# Please contact me if you have troubles configuring ipcad. My goal is to make
# initial configuration easier for new users, so your input is valuable.
#

##################
# GLOBAL OPTIONS #
##################

#
# Enable or disable capturing UDP and TCP port numbers, IP protocol and
# ICMP types for RSH output.
#
#     capture-ports &#123;enable|disable&#125; ;
#
# Enabling this will BREAK Cisco RSH output format compatibility,
# increase memory requirements and may slow down traffic processing.
# This option takes effect IMMEDIATELY, that is, it can be specified
# multiple times, even between interfaces configuration.
# This option has NO effect on NetFlow operation &#40;NetFlow always captures
# port information&#41;.
#

capture-ports disable;

#
# Buffers to be used for transferring the data from the kernel,
# if applicable &#40;BPF, ULOG&#41;.
# Using larger buffers may increase the performance but will
# affect responsiveness.
#
# buffers = <number>&#91;&#123;k|m&#125;&#93; ;
#
# Reasonable defaults are used if this parameter is not set.
#

buffers = 64k;


#####################
# INTERFACE OPTIONS #
#####################

#
# interface <iface> &#91; promisc &#93; &#91; input-only &#93;
#			&#91; netflow-disable &#93; &#91; filter "<pcap_filter>" &#93; ;
# OR
# interface ulog group <group> &#91;, group <group> ...&#93;
#			&#91; netflow-disabled &#93;;
# OR
# interface ipq &#91; netflow-disabled &#93;;	# man libipq&#40;3&#41;
# OR
# interface &#123;divert|tee&#125; port <divert-port>			# man divert&#40;4&#41;
#			&#91; input-only &#93; &#91; netflow-disabled &#93;;
# OR
# interface file <tcpdump-output.pcap> &#91; netflow-disabled &#93;;
#
# Options meaning&#58;
#
# promisc&#58;
# 	Put interface into promiscuous mode.
# 	This enables listening for the packets which are not destined for
# 	this host and thus ipcad will count and display all the traffic within
# 	the local network. Note that the interface might be in promiscuous mode
# 	for some other reason.
#
# input-only&#58; 
# 	Use kernel feature of counting only incoming packets.
#
# netflow-sampled&#58; 	&#40;DO NOT ENABLE THIS OPTION, unless you have to!&#41;
# 	If the NetFlow export mechanism is used, this option instructs
#	the interface to supply only one out of N packets to the NetFlow
#	accounting code, thus lowering the CPU requirements. The value of N
#	is configured explicitly in a NetFlow configuration section.
#	NOTE&#58; This option is NOT used to enable NetFlow on the interface,
#	it just modifies the NetFlow behavior on this interface.
#	DO NOT ENABLE THIS OPTION, UNLESS YOU HAVE TO!
#
# netflow-disable&#58; 
#	By default, all interfaces are included into NetFlow accounting.
#	This option is used to disable NetFlow on a particular interface.
#
# filter&#58; 
# 	Install a custom filter on packets instead of basic
#	IP protocol filter. Requires libpcap &#40;even if BPF is being used&#41;.
#	May be employed to eliminate CPU overhead on passing unnecessary
#	data between the kernel and user space &#40;by installing the filter
#	directly into the kernel&#41;.
#
# NOTES&#58;
#  * "input-only" directive must be supported by kernel.
#    Probably, you were noticed about it during the compilation process
#    if it was not supported.
#    FreeBSD 3.x and elder kernels do not support this feature.
#  * ULOG packet source &#40;interface ulog&#41; is supported under
#    Linux >= 2.4.18-pre8.
#    You should configure iptables to dump the packet stream
#    into the appropriate group, i.e.&#58;
#        iptables -A OUTPUT -j ULOG --ulog-nlgroup <group>
#    Given ULOG groups will be OR'ed together.
#  * A wildcard &#40;*&#41; may be specified as part of an interface name.
#

interface eth0;
interface eth1;

#interface ed0;
#interface ed1 promisc filter "ip and not dst net 192.168.0.0/16";
#interface sbni0 input-only netflow-disable;	# Disable NetFlow.
#interface ppp*;				# Dynamically pick up PPP interfaces.
#interface ulog group 3, group 15;	# Use ULOG, do not disable NetFlow.
#interface ipq;				# Use Linux IPQ &#40;libipq&#40;3&#41;&#41;
#interface tee port 123;			# Use BSD ipfw&#40;8&#41;'s tee.
#interface divert port 321 netflow-disable;	# Use ipfw&#40;8&#41;'s divert&#40;4&#41;.

#
# aggregate <ip>/<masklen> strip <maskbits> ;
#
# Aggregate addresses from the specified network &#40;<ip>/<masklen>&#41;,
# by AND'ing with specified mask &#40;<maskbits>&#41;.
#
#

aggregate 192.168.0.0/24 strip 32; /* Don't aggregate internal range */
aggregate 0.0.0.0/0 strip 24;	/* Aggregate external networks */

#
# aggregate <port_range_start>&#91;-<port_range_end>&#93; into <port> ;
#
# Aggregate port numbers. Meaningful only if capture-ports is enabled.
#

aggregate 1024-65535	into 65535;	/* Aggregate wildly */
aggregate 3128-3128	into 3128;	/* Protect these ports */
aggregate 150-1023	into 1023;	/* General low range */


##########################
# NetFlow EXPORT OPTIONS #
##########################

#
# Enable Cisco NetFlow export method.
# NetFlow uses UDP to feed flow information to the receiver.
# If the destination is not specified, NetFlow is disabled.
#

# netflow export destination 127.0.0.1 9996;
netflow export version 5;	# NetFlow export format version &#123;1|5&#125;
netflow timeout active 30;	# Timeout when flow is active, in minutes
netflow timeout inactive 15;	# Flow inactivity timeout, in seconds
netflow engine-type 73;		# v5 engine_type; 73='I' for "IPCAD"
netflow engine-id 1;		# Useful to differentiate multiple ipcads.

# The following option is enabled by the "netflow-sampled" interface flag.
#netflow sampling-mode packet-interval 10;   # 1 out of 10 packets accounted
# DO NOT ENABLE THIS UNLESS YOU KNOW WHAT ARE YOU DOING.

#
# NetFlow protocol exports an SNMP id instead of the interface name
# &#40;i.e., "eth0", "ppp32"&#41;. The following statements options define
# mapping between the interface names and a set of "SNMP identifiers".
#
netflow ifclass eth mapto 0-99;		# i.e., "eth1"->1, "eth3"->3
netflow ifclass fxp mapto 0-99;		# i.e., "fxp4"->4, "fxp0"->0
netflow ifclass ppp mapto 100-199;	# i.e., "ppp32"->532, "ppp7"->507
netflow ifclass gre mapto 200-299;
netflow ifclass tun mapto 300-399;	# i.e., "tun0"->300

######################
# RSH SERVER OPTIONS #
######################

#
# Enable RSH Server&#58;
#
#   rsh &#123;enable|yes|on|disable|no|off&#125; &#91;at <listen_ip>&#93;;
#
# If "at <listen_ip>" omitted, rsh server listens on IP address 0.0.0.0,
# which may be undesirable.
#

rsh enable at 127.0.0.1;

#
# RSH access rules&#58;
#
# rsh &#91;<user>@&#93;<host_addr> &#123;admin|backup|&#91;default&#93;|view-only|deny&#125; ;
#

rsh root@127.0.0.1 admin;	/* Can shutdown ipcad */
rsh root@127.0.0.1 backup;	/* Can dump/restore/import accounting table */
rsh root@127.0.0.1;		/* Can view and modify accounting tables */
/* Note the order! */
#rsh luser@127.0.0.1 deny;	/* Deny this user from even viewing tables */
rsh 127.0.0.1 view-only;	/* Other users can view current tables */

# Keep IP packet time to live reasonably low to avoid remote attacks.
# &#40;The rsh client must reside no more than three hops away from the
# router running ipcad.&#41;
rsh ttl = 3;

# Set rsh timeout for the same purpose.
rsh timeout = 30;

#
# Dump active IP accounting table to this file on exit and read on startup.
# &#40;read about -s and -r options in ipcad&#40;8&#41; manual page&#41;
# NOTE&#58; This setting has no effect on NetFlow operation. The flow cache
#       contents are flushed to the collector upon ipcad termination.
#

dumpfile = /var/log/ipcad/ipcad-curr.dump;	# The file is inside chroot&#40;&#41;, see below...

#################
# OTHER OPTIONS #
#################

#
# Chroot to this directory before processing.
#
# Of course, you could disable chroot&#40;&#41;'ing by commenting it out,
# but it is not recommended, so I left this confusing default
# to encourage you to change it.
#

#chroot = /adm/tmp;

#
# File to keep getpid&#40;&#41; in it. ipcad will also hold a lock.
#
# WARNING&#58; Pidfile is created AFTER chroot&#40;&#41;'ing, so if you're using
# chroot statement above, make sure the path to the pidfile exists
# inside chrooted environment.
#

pidfile = /var/run/ipcad.pid;

#
# UID/GID privileges dropping
# Please note&#58; RSH service will be UNAVAILABLE when uid is not zero.
# Use it only when you know what are you doing &#40;i.e., NetFlow without RSH&#41;.
#
# uid = 65534;
# gid = 65534;

#
# Few useful settings.
#

#
# Memory usage limit for storing per-stream entries.
# 
# memory_limit = <number>&#91;&#123;k|m|e&#125;&#93; ;
# Where k, m and g are for kilobytes, megabytes or table "entries".
#

memory_limit = 10m; 

Ответить