netacct-mysql и OpenVPN (подсчет tun0 интерфейса)

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

leksstav
Сообщения: 331

netacct-mysql и OpenVPN

Сообщение leksstav »

Пользователи в локальной сети авторизируются в OpenVPN логин пароль и выходят в интернет каждому присваивается постоянно один и тот же ip.
Прога netacct-mysql прекрасно снимает трафик, но вот на фейсе tun0 не хочет или я конфиг неправильно настроил (знакомый говорит что работает)
eth0 интернет
eth1 локалка
tun0 OpenVPN через который юзеры ходят в нет

Конфиг настроен следующим образом


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

$this_var = "sniff 0                # 0 = not setting PROMISC mode
                # 1 = put interface in PROMISC mode

database mysql            # must be mysql for now

mysql_user acct            # usually you don't need to change this

mysql_password acct_password    # change this to your password

mysql_host localhost        # sometimes you need to change this to
                # 127.0.0.1 instead of localhost

mysql_port 0            # mysql port, 0 if you are using a socket

mysql_database netacct        # usually you don't need to change this

pidfile  /var/run/nacctd.pid    # set pid file
                # tis will help if you want to
                # two (or more) nacctd on same machine

#compactnet 62.73.77.0 255.255.255.0
compactnet 10.8.75.0 255.255.255.0

                 # log traffic only for these networks
                # all other packets are NOT logged

ournet 10.8.75.0 255.255.255.0

                # Ours IP nets for diferenciation of
                # peering traffic types

#direct_peer 217.75.132.0 255.255.255.0
#direct_peer 62.176.90.0 255.255.255.0
#direct_peer 212.72.212.0 255.255.255.0
#direct_peer 217.75.136.0 255.255.255.0
#direct_peer 194.12.226.80 255.255.255.240
#direct_peer 194.12.233.96 255.255.255.224
#direct_peer 194.12.233.160 255.255.255.224

                # log traffic between 2 or more regional ISP-s

flush 30                       # flush every 5 minutes
                # this gives the interval in seconds
                # when the accumulated data is flushed
                # to the output file

#errdelay 2
fdelay 30

notdev eth0            # Dont log entries for this device
                                # Use this on routers that you dont
                                # log forwarded packets twice.

device tun0                     # device to put into promiscous mode
                # you can specify as many as you want
                # and you don't have to specify one
                # (e.g. if this runs on your router)
                #
                # if you plan to use it on some *BSD
                # system put here apropriate device
                # i.e. - device ep0

iflimit tun0            # on machines with multiple interfaces,
                # log only packets on this interface
                # mutually exclusive with hostlimit

#ignoremask 255.255.255.0        # Ignore traffic on same class C net
                # This means traffic that is on
                # your local LAN is not counted.
                # This is useful for NFS etc.
                # Not giving this option causes everything
                # to be counted.
                # This can degrade performance seriously!

ignorenet 127.0.0.0 255.0.0.0   # ignore loopback net
                # You can define as many ignorenets as
                # you want. Ignoring a net with
                # ignorenet is not as efficient as
                # ignoremask. Thus you should exclude
                # your local network with ignoremask,
                # not with ignorenet (although this is
                # is possible).

debug 4                         # set debugging level
debugfile /tmp/nacctd.debug    # where to put debugging info";



В дебаге такая инфа

21/07 10:33:49 [STATE] write_log called
21/07 10:33:49 [STATE] lck = 1
21/07 10:33:49 [STATE] lck = 0
21/07 10:33:49 [STATE] parent: synchronized with write child
21/07 10:33:49 [STATE] writepid is 10403
21/07 10:33:49 [STATE] done freeing
21/07 10:33:49 [STATE] write child: synchronized with parent
21/07 10:33:49 [STATE] * write process 10403 forked
21/07 10:33:49 [STATE] -> got signal 17, handling
21/07 10:33:49 [STATE] set writing to 0
21/07 10:33:49 [STATE] child 10403 signaled return
21/07 10:33:49 [STATE] <- got signal 17, done handling
21/07 10:34:19 [STATE] write_log called
21/07 10:34:19 [STATE] lck = 1
21/07 10:34:19 [STATE] lck = 0
21/07 10:34:19 [STATE] parent: synchronized with write child
21/07 10:34:19 [STATE] writepid is 10447
21/07 10:34:19 [STATE] done freeing
21/07 10:34:19 [STATE] write child: synchronized with parent
21/07 10:34:19 [STATE] * write process 10447 forked
21/07 10:34:19 [STATE] -> got signal 17, handling
21/07 10:34:19 [STATE] set writing to 0
21/07 10:34:19 [STATE] child 10447 signaled return
21/07 10:34:19 [STATE] <- got signal 17, done handling
21/07 10:34:49 [STATE] write_log called
21/07 10:34:49 [STATE] lck = 1
21/07 10:34:49 [STATE] lck = 0
21/07 10:34:49 [STATE] parent: synchronized with write child
21/07 10:34:49 [STATE] writepid is 10449
21/07 10:34:49 [STATE] done freeing
21/07 10:34:49 [STATE] write child: synchronized with parent
21/07 10:34:49 [STATE] * write process 10449 forked
21/07 10:34:49 [STATE] -> got signal 17, handling
21/07 10:34:49 [STATE] set writing to 0
21/07 10:34:49 [STATE] child 10449 signaled return
21/07 10:34:49 [STATE] <- got signal 17, done handling
21/07 10:35:19 [STATE] write_log called
21/07 10:35:19 [STATE] lck = 1
21/07 10:35:19 [STATE] lck = 0

Кто может подсказать в каком направлении рыть
Спасибо сказали:
leksstav
Сообщения: 331

Re: netacct-mysql и OpenVPN

Сообщение leksstav »

Неужели никто не сталкивался..........
Спасибо сказали: