I activated Netflow on a Cisco 7206 router and well installed as-stats, but I get empty rrd directories like that:
root@netflow /opt/as-stats/rrd# ll * -R
00:
total 0
01:
total 0
02:
total 0
03:
total 0
My know links file:
root@netflow ~# cat /etc/as-stats/netflow-links
Y.Y.Y.Y 4 Transit-PAR Transit-PAR A6CEE3 1
Netflow flows are well received on my server:
root@netflow ~# tcpdump -nvvv port 9000
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
23:12:59.386376 IP (tos 0x0, ttl 254, id 51715, offset 0, flags [none], proto UDP (17), length 1492)
Y.Y.Y.Y.57049 > X.X.X.X.9000: [udp sum ok] UDP, length 1464
The config on my router (gi0/2 is the interface where my transit goes out)
ip flow-cache timeout active 5
interface GigabitEthernet0/2
ip flow egress
interface Loopback0
ip address Y.Y.Y.Y 255.255.255.255
ip flow-export source Loopback0
ip flow-export version 5 origin-as
ip flow-export destination X.X.X.X 9000
ip flow-aggregation cache as
cache entries 16384
cache timeout active 5
export destination X.X.X.X 9000
enabled
router#show snmp mib ifmib ifindex
GigabitEthernet0/2: Ifindex = 4
router#show ip flow export
Flow export v5 is enabled for main cache
Export source and destination details :
VRF ID : Default
Source(1) Y.Y.Y.Y (Loopback0)
Destination(1) X.X.X.X (9000)
Version 5 flow records, origin-as
Cache for as aggregation v8
VRF ID : Default
Source(1) Y.Y.Y.Y (Loopback0)
Destination(1) X.X.X.X (9000)
161288425 flows exported in 4610418 udp datagrams
0 flows failed due to lack of export packet
0 export packets were sent up to process level
0 export packets were dropped due to no fib
12435 export packets were dropped due to adjacency issues
0 export packets were dropped due to fragmentation failures
0 export packets were dropped due to encapsulation fixup failures
Any idea about what's wrong in my configuration?
Thank you,
Gauthier
Check the incoming NetFlow packets with Wireshark (you may have to select "Decode As..." -> CFLOW) and ensure that source/destination AS information is present in them.
> interface GigabitEthernet0/2
> ip flow egress
I'm not sure whether AS aggregation works on egress. You may have to use "ip flow ingress" instead (on both internal and external interfaces if you want AS stats for both directions).
This sample looks like it's from your AS to some other AS on the Internet (that's why the src is 0). Therefore, AS-Stats only looks at the output ifindex, which is 4 and apparently not defined in your knownlinks file.
You don't need to list your internal interfaces in the knownlinks file, but you need to enable "ip flow ingress" on them so that AS-Stats will see outgoing traffic from your AS.
There are some commented out "print" statements in the script that you can enable to get more information on what is going on inside the script.
It's probably the dash in your tag (knownlinks file) - RRDtool only allows the characters 0-9 a-z A-Z and _. Also make sure you're using tabs and not spaces to separate the fields.