I am using Netflow (IPFIX) on two different routers that both use IPv4 and IPv6.
I configured the Netflow interface to be the internet interface.
On a CCR1009 it works OK, I get all netflow information.
On a RB750Gr3 I am seeing strange behaviour: I do get both the inbound and outbound flows for IPv4, but
for IPv6 I mostly get only the outbound flows, and an occasional inbound flow but most of them are missing.
(e.g. when a https connect is made I do get the flow with DstPort 443, but not the corresponding flow with
SrcPort 443 and the addresses swapped)
Maybe 1% of the flows are still reported, though. It is just that the majority is missing so bytes downloaded
per users is very small.
Anyone seen that before? It happened with 6.46.2 but that was when I configured the Netflow, and recently
I updated to 6.47 and the issue has remained the same (I sort of hoped the reboot would fix it)
Slightly offtopic but which Netflow platform do you use ? Something commercial or opensource ?
I’ve been playing some days ago with Netflow/IPFIX on my RB3011.
I use a Perl script that uses the Net::Flow library (it is mostly copied from an example provided with that library) to write the flow info to a tab-separated file rotated each day.
Then I wrote another Perl script that adds-up the byte counts grouped per user MAC to see where exceptionally high usage comes from when the line is overloaded.
It is mainly intended as a log in case of abuse or piracy, not to make nice graphs. Normally nobody even looks at those logs until there is some issue.
#!/bin/sh
# rotate the netflow log once a day and compress logfiles
base="router"
now=`date +%Y%m%d`
cd /var/log/netflow || exit 1
# remove logfiles older than 180 days
find . -mtime +180 -exec rm -f {} \;
# restart daemon writing to logfile for today
killall -s 2 netflow.pl
sleep 2
umask 077
/usr/local/bin/netflow.pl >>$base-$now 2>>netflow.out </dev/null &
sleep 2
# compress logfiles before today
for file in $base-????????
do
if [ "$file" != "$base-$now" ]
then
bzip2 -9 $file
fi
done
This is run at startup of the machine and at 00:00 every day. It writes in the directory /var/log/netflow that should be writable for the user that runs the script.
(does not need to be root)
It is normal that some errors “WARNING : NOT FOUND TEMPLATE=258” are written to netflow.out, this is because the netflow template is inserted every so many records, so records received before this template comes by cannot be processed. This is e.g. set to once every 20 records / 1800 seconds.