# How to calculate the traffic on one of the uplinks



## allan_sundry (Oct 13, 2011)

Hi

I have a server with FreeBSD 8.2 has two network interfaces and igb0 igb1.
At igb0 created vlan 1 - vlan N for users, at igb1 two uplink - vlan 1000 and 2000.
Shaping with ipfw + dummynet using tables.
Network in vlan 1000 comes to a server using the BGP (quagga), in vlan 2000(networks that are not in vlan 1000) - default gateway.

How can I calculate traffic from users on vlan 1 - vlan N to vlan 2000 and in the opposite direction?

Can I use to address this issue ng_netflow?


----------



## allan_sundry (Oct 13, 2011)

Judging by the structure of the package netflow version 5 there exist interesting

12-13, input, SNMP index of input interface
14-15, output, SNMP index of output interface

How can I filter the data based on the values â€‹â€‹of incoming and outgoing interfaces?


----------



## ecazamir (Oct 13, 2011)

Usually, a netflow export includes an interface index, this could be used for filtering.
What software do you use for netflow collection and reporting ?


----------



## allan_sundry (Oct 14, 2011)

VLAN or his name would appear on the interface index?


----------



## Abriel (Oct 14, 2011)

I don't know if it will be good, I read man, and there is support for vlan. I am using it to calculate the traffic internet.
net-mgmt/pmacct


----------



## ecazamir (Oct 14, 2011)

If you don't need detailed reports, probably netstat or snmp should report useful figures. Combine these with rrdtool or cacti and you'll get what you need.
RRDTool is a very powerful tool, not only for creating graphs.

On a machine i use:
- a shell script invoked from cron, which looks at some counters (with netstat, but it could be any form of counter gatherer), and then put the data into a rrdtool database
- a web page invoking a php script, which reads data from the same rrdtool database, to create a graph. This graph is able to show two things: how fast was the traffic flow, and what amount of dat ahas been transferred.

Setting the start and stop period for the graph is easy.

On the scenario above, all the work (data collection and graph creation) is done on a single machine.



			
				allan_sundry said:
			
		

> VLAN or his name would appear on the interface index?



i'm not sure. Most netflow analyzers are able to do a snmp query to determine the interface names. As an example, i refer to 'Adventnet Netflow Analyzer'.


----------

