配置新的Cisco交换机2900系列和4900系列

利用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上支持。

 

在交换机配置模式下创建Flow记录:

Switch(config)# flow record NfliteRecord
Switch(config-flow-record)# collect counter bytes long
Switch(config-flow-record)# collect counter packets long
Switch(config-flow-record)# collect flow sampler
Switch(config-flow-record)# collect interface input
Switch(config-flow-record)# collect timestamp sys-uptime first
Switch(config-flow-record)# collect timestamp sys-uptime last
Switch(config-flow-record)# collect transport tcp flags ack
Switch(config-flow-record)# collect transport tcp flags fin
Switch(config-flow-record)# collect transport tcp flags rst
Switch(config-flow-record)# match datalink ethertype
Switch(config-flow-record)# match datalink mac source address input
Switch(config-flow-record)# match datalink mac destination address input
Switch(config-flow-record)# match ipv4 protocol
Switch(config-flow-record)# match ipv4 destination address
Switch(config-flow-record)# match ipv4 source address
Switch(config-flow-record)# match ipv4 tos
Switch(config-flow-record)# match ipv6 protocol // optional : for IPv6 only
Switch(config-flow-record)# match ipv6 destination address // optional : for IPv6 only
Switch(config-flow-record)# match ipv6 source address // optional : for IPv6 only
Switch(config-flow-record)# match ipv6 tos // optional : for IPv6 only
Switch(config-flow-record)# match transport destination-port
Switch(config-flow-record)# match transport source-por

 

在交换机配置模式下创建Flow导出器:

Switch(config)# flow exporter NfliteExporter

Switch(config-flow-exporter)# destination 10.10.10.10 // Nfa server IP
Switch(config-flow-exporter)# export-protocol netflow-v9
Switch(config-flow-exporter)# option interface-table
Switch(config-flow-exporter)# option exporter-stats
Switch(config-flow-exporter)# option sampler-table
Switch(config-flow-exporter)# source loopback 0 // source interface can be any L3 interface
Switch(config-flow-exporter)# template data timeout 60
Switch(config-flow-exporter)# transport udp 9996

 

在交换机配置模式下创建Flow监视器:

Switch(config)# flow monitor NfliteMonitor
Switch(config-flow-monitor)# record NfliteRecord
Switch(config-flow-monitor)# exporter NfliteExporter
Switch(config-flow-monitor)# cache timeout active 60
Switch(config-flow-monitor)# cache timeout inactive 15
Switch(config-flow-monitor)# cache type normal
Switch(config-flow-monitor)# statistics packet protocol

 

在交换机配置模式下创建Flow采样器:

Switch(config)# sampler NfliteSampler
Switch(config-sampler)# mode random 1 out-of 32 // The range can be 32 to 1022

 

在接口配置模式下将Flow监视器应用于接口:

Switch(config)# interface gigabitethernet 0/0
Switch(config-if)# ip flow monitor NfliteMonitor sampler NfliteSampler input // Repeat this command on all interfaces.

 

Back to Top