pmacct-discussion  

Re: [pmacct-discussion] LVS and pmacct

alex
Mon, 02 Jun 2008 04:36:33 -0700

    Try to start tcpdump and see what packets it capture. Such traffic
should see and account pmacct also.

   tcpdump -i eth1 dst net 202.45.102.0/24

    But with such filter you will account all internal traffic also
(from internal networks or same network) that i think isn't what you want.
Try next:

   dst net 202.45.102.0/24 and src net ! (202.45.102.0/24 and 
192.168.1.0/24)

   And one accurate definition. Balances external request between
internal servers make LVS not Keepalived. Keepalived make convenient
configuration and VRRP gateway reservation.

    Alex


> Hi Alex,
> 
> Yeah I got that bit ;)
> 
> What I don't understand is with my current configuration why isn't the
> accounting "counting" anything to do with the virtual ip's on eth1
> 202.45.102.90 and 202.45.102.70 there the IP's that should be getting all
> web traffic for those sites and then keepalived balances them over the 
>nat'd
> servers on eth2.
> 
>    Hello Adam!
>    For begin as i understand you must start one 'pmacctd' daemon (with
> own config) for every interface that you must accouting traffic. In
> configs you must set up relative interface, aggregate_filter, aggregate
> and other parameters.
> 
>    Alex
> 
> 
>> Hi guys,
>> 
>> I need a little help in counting the traffic via my
>> router/firewall/keepalived machine (yes it's one box with 3 nics)
>> 
>> I have pmacct setup with this config and it is working a treat for my
>> "normal" servers, I'm just not sure now how do I count the traffic for the
>> load balanced servers. I do know I have to run multiple pmacctd daemons 
>>with
>> multiple configs to track multiple interfaces, but I'm not sure which
>> interface I need to track.
>> 
>> debug: true
>> logfile: /var/log/pmacct.log
>> daemonize: true
>> promisc: false
>> interface: eth1
>> 
>> plugins: mysql[in0], mysql[out0]
>> 
>> aggregate[in0]: dst_port,dst_host,proto
>> aggregate_filter[in0]: dst net 202.45.102.0/24
>> sql_table[in0]: eth1_in
>> 
>> aggregate[out0]: src_port,src_host,proto
>> aggregate_filter[out0]: src net 202.45.102.0/24
>> sql_table[out0]: eth1_out
>> 
>> sql_recovery_logfile[in0]: /root/recovery-in0.sql
>> sql_recovery_logfile[out0]: /root/recovery-out0.sql
>> 
>> sql_host: XXXXXX
>> sql_db: pmacct
>> sql_table_version: 1
>> sql_user: XXXXXX
>> sql_passwd: XXXXXX
>> sql_refresh_time: 60
>> sql_optimize_clauses: true
>> sql_history: 1m
>> sql_history_roundoff: mh
>> sql_dont_try_update: true
>> 
>> The issue is I now have setup keepalived to load balance a couple of 
>>servers
>> via a 3rd network card.
>> Being a firewall as well as my router AND load balancer the keepalived 
>>side
>> of things puts the virtual ip's onto eth0, and then nats these via eth2 
>>for
>> the machines I'm load balancing.
>> 
>> firewall# ip addr
>> 3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
>>    link/ether 00:40:d0:43:b7:cc brd ff:ff:ff:ff:ff:ff
>>    inet 202.45.103.86/30 brd 202.45.103.87 scope global eth0
>>    inet 202.45.102.91/32 scope global eth0
>>    inet 202.45.102.92/32 scope global eth0
>>    inet 202.45.102.71/32 scope global eth0
>>    inet 202.45.102.72/32 scope global eth0
>> 4: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
>>    link/ether 00:0e:0c:d0:71:bc brd ff:ff:ff:ff:ff:ff
>>    inet 202.45.102.1/25 brd 202.45.102.127 scope global eth1
>>    inet 202.45.102.90/32 scope global eth1
>>    inet 202.45.102.70/32 scope global eth1
>> 5: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
>>    link/ether 00:40:d0:43:b7:cd brd ff:ff:ff:ff:ff:ff
>>    inet 192.168.1.1/24 brd 192.168.1.255 scope global eth2
>> 
>> I have no issues tracking the traffic for all the "normal" servers via 
>>eth1
>> but how do I account for the keepalived virtual ip's on eth0 (and for some
>> reason the virtual ip's on eth1 202.45.102.90 and 202.45.102.70 aren't
>> showing any traffic with the above config)
>> I guess I'm not sure how to setup the aggregate filters for accounting the
>> traffic on eth0 and eth2.
             


------
Новые условия по вкладам! До 11% годовых в USD, до 14% годовых в BYR.
Возможность распоряжаться средствами без потери доходности.
Международная карточка VISA - в подарок! Белросбанк, т.(017) 21-000-22,
http://www.belrosbank.by


_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists