|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|
|||
Netflow accounting using pflow
Hi folks,
I plan to move our core routers from FreeBSD to OpenBSD. Currently I use netgraph and ng_netflow on the FreeBSD machines for netflow accounting. As there is a netflow kernel implentation with pflow in OpenBSD, too, I decided to use this. Unfortunately I seems that flows are exported twice for each connection. A quick example: I have a machine that collects the netflows: Code:
deb-01:~# flow-receive 0.0.0.0/0.0.0.0/2100 -o bsdflow flow-receive: setsockopt(size=4194304) flow-receive: New exporter: time=1294143869 src_ip=192.168.89.150 dst_ip=192.168.89.52 d_version=5 Code:
rtr-fra-01# cat /etc/hostname.pflow0 flowsrc 192.168.89.150 flowdst 192.168.89.52:2100 rtr-fra-01# grep -v ^\# /etc/pf.conf set skip on lo pass keep state (pflow) # to establish keep-state block in on ! lo0 proto tcp to port 6000:6010 rtr-fra-01# Code:
grabnebel:~# nuttcp -i1 192.168.92.55 102.0721 MB / 1.00 sec = 856.2173 Mbps 111.3174 MB / 1.00 sec = 933.8174 Mbps 111.6529 MB / 1.00 sec = 936.6071 Mbps 111.6529 MB / 1.00 sec = 936.5912 Mbps 111.6529 MB / 1.00 sec = 936.6240 Mbps 111.6529 MB / 1.00 sec = 936.6287 Mbps 111.6571 MB / 1.00 sec = 936.6241 Mbps 111.6529 MB / 1.00 sec = 936.6296 Mbps 111.6598 MB / 1.00 sec = 936.6725 Mbps 111.6529 MB / 1.00 sec = 936.5959 Mbps 1108.1875 MB / 10.01 sec = 928.3151 Mbps 6 %TX 20 %RX grabnebel:~# Code:
rtr-fra-01# pfctl -vss | grep -A2 5001 all tcp 192.168.92.55:5001 <- 192.168.89.55:50609 FIN_WAIT_2:FIN_WAIT_2 [3659736762 + 5888] wscale 6 [491808162 + 1749184] wscale 6 age 00:00:39, expires in 00:01:01, 802503:402038 pkts, 1203748980:20916988 bytes, rule 0, pflow all tcp 192.168.89.55:50609 -> 192.168.92.55:5001 FIN_WAIT_2:FIN_WAIT_2 [491808162 + 1749184] wscale 6 [3659736762 + 5888] wscale 6 age 00:00:39, expires in 00:01:01, 802503:402038 pkts, 1203748980:20916988 bytes, rule 0, pflow rtr-fra-01# Code:
deb-01:~# flow-print < bsdflow | grep 5001 192.168.89.55 192.168.92.55 6 50609 5001 1203748980 802503 192.168.92.55 192.168.89.55 6 5001 50609 20916988 402038 192.168.89.55 192.168.92.55 6 50609 5001 1203748980 802503 192.168.92.55 192.168.89.55 6 5001 50609 20916988 402038 deb-01:~# Any suggestions? Regards, Bernd |
|
|||
Ok. Obviously there are states for each interface the traffic passes.
Restricting the pflow flag to only outgoing traffic solves the problem. Code:
pass out keep state (pflow) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FOSS web-based accounting? | DraconianTimes | Off-Topic | 0 | 16th November 2008 02:20 PM |