利用NetFlow技术,网络管理员可以更有效地监视带宽利用率,从而了解容量规划和资源分配情况。直到现在,Netflow监控只支持Cisco高端的交换机,比如Cisco Catalyst 3K、4K、6K系列交换机。Cisco的NetFlow-Lite是轻量型的,基于数据包的采样技术,用于监控广泛使用的交换机上的交换流量。有了Cisco NetFlow-Lite,管理员现在可以很轻松地监控不同Cisco交换机的带宽情况。
NetFlow-Lite目前支持Cisco Catalyst 2960-X和4948E。NetFlow-Lite可以配置为Version9或者IPFIX导出字段。到目前为止,在NetFlow-Lite里只有ingress监控可用。现在,NetFlow-Lite包括新的字段比如 MAC 地址和选择模板,但是这些字段目前在NetFlow Analyzer界面上不可用,在后续的版本中可能会实现。
不像传统的NetFlow,在NetFlow-Lite中采样是强制性的。这里有两种可用采样算法—确定性和随机性采样。随机性采样可以监视所有接口,确定性采样可用于设备的有限接口。
现在可以用下面的命令去配置交换机,输出NetFlow-Lite流到NetFlowAnalyzer服务器上。这些命令在Cisco IOS 15.0(2)EX1上支持。
Switch(config)# flow record NfliteRecordSwitch(config-flow-record)# collect counter bytes longSwitch(config-flow-record)# collect counter packets longSwitch(config-flow-record)# collect flow samplerSwitch(config-flow-record)# collect interface inputSwitch(config-flow-record)# collect timestamp sys-uptime firstSwitch(config-flow-record)# collect timestamp sys-uptime lastSwitch(config-flow-record)# collect transport tcp flags ackSwitch(config-flow-record)# collect transport tcp flags finSwitch(config-flow-record)# collect transport tcp flags rstSwitch(config-flow-record)# match datalink ethertypeSwitch(config-flow-record)# match datalink mac source address inputSwitch(config-flow-record)# match datalink mac destination address inputSwitch(config-flow-record)# match ipv4 protocolSwitch(config-flow-record)# match ipv4 destination addressSwitch(config-flow-record)# match ipv4 source addressSwitch(config-flow-record)# match ipv4 tosSwitch(config-flow-record)# match ipv6 protocol // optional : for IPv6 onlySwitch(config-flow-record)# match ipv6 destination address // optional : for IPv6 onlySwitch(config-flow-record)# match ipv6 source address // optional : for IPv6 onlySwitch(config-flow-record)# match ipv6 tos // optional : for IPv6 onlySwitch(config-flow-record)# match transport destination-portSwitch(config-flow-record)# match transport source-por
Switch(config)# flow exporter NfliteExporter
Switch(config-flow-exporter)# destination 10.10.10.10 // Nfa server IPSwitch(config-flow-exporter)# export-protocol netflow-v9Switch(config-flow-exporter)# option interface-tableSwitch(config-flow-exporter)# option exporter-statsSwitch(config-flow-exporter)# option sampler-tableSwitch(config-flow-exporter)# source loopback 0 // source interface can be any L3 interfaceSwitch(config-flow-exporter)# template data timeout 60Switch(config-flow-exporter)# transport udp 9996
Switch(config)# flow monitor NfliteMonitorSwitch(config-flow-monitor)# record NfliteRecordSwitch(config-flow-monitor)# exporter NfliteExporterSwitch(config-flow-monitor)# cache timeout active 60Switch(config-flow-monitor)# cache timeout inactive 15Switch(config-flow-monitor)# cache type normalSwitch(config-flow-monitor)# statistics packet protocol
Switch(config)# sampler NfliteSamplerSwitch(config-sampler)# mode random 1 out-of 32 // The range can be 32 to 1022
Switch(config)# interface gigabitethernet 0/0Switch(config-if)# ip flow monitor NfliteMonitor sampler NfliteSampler input // Repeat this command on all interfaces.