Hello Dmitriy,
follow my reply inline.

On Sun, May 22, 2005 at 07:49:46PM +0300, Dmitriy Sirant wrote:

> 1. If i use two plugins for in and for out (plugins: mysql[in], 
> mysql[out]) can i write all data to one table (sql_table[in]: acct, 
> sql_table[out]: acct)

Sure. Moreover, applying 'sql_startup_delay' to one plugin will help in
avoiding them accessing the table at the same time (which is quite bad
because of locking). However - as an alternative approach - you may
consider using Pre-Tagging for the purpose:

a) you may configure pmacct with a single plugin plus the following line:
   'pre_tag_map: pretag.map'

b) in the pretag.map file you may insert the following two lines:
   id=1 filter='src net 192.168.0.0/16'
   id=2 filter='dst net 192.168.0.0/16'

This way you will have a single plugin writing to the 'acct' table (and
this is good) and outgoing traffic will be marked as '1' in the agent_id
field, while the incoming one will be marked as '2'.

> 2. Can i use in aggregate_filter "and" or "or", as example: dst net 
> 193.238.116.0/22 or dst net 192.168.0.0/16

Sure !

> 3. Have anybody working scheme for billing ? I have such scheme: Two 
> different gateway to one provider. Have AS. Have PI IP. In own network 
> have private IP (192.168.0.0/16), that NAT on gateways. On both gateways 
>  need to account all traffic from clients (private IP and real IP) and 
> to clients (private IP and real IP). But present clients that in some 
> moments go throw both gateways and, as i understand traffic counters 
> will duplicate. Calculate on external interface - not calculate NATed IP.

Can you draw a simple (ASCII) picture of the environment ?

Cheers,
Paolo

Reply via email to