Hands-On Lab: Configuring NetFlow

This hands-on lab enables NetFlow on a router interface to collect traffic flow statistics, exports the data to a collector, and verifies flow records accurately reflect actual traffic passing through the monitored interface.

NetFlow ConfigurationFlow ExporterTraffic Flow Statistics

~3 دقیقه مطالعه · آخرین به‌روزرسانی ۱ مهر ۱۴۰۵

Lab Objective

Enable NetFlow on a router interface, configure a flow exporter pointing to a collector, and verify the resulting flow records accurately describe actual traffic traversing that interface.

Lab Purpose

While SPAN, covered in the previous lab, copies entire packets for deep inspection, NetFlow instead summarizes traffic into flow records (source, destination, ports, byte counts) without copying full packet contents — a far more scalable approach for long-term traffic analysis and capacity planning across many interfaces simultaneously.

Lab Topology

R1 ---- Gi0/0: 192.168.67.1/24 (LAN, traffic
                                 to be monitored)

NetFlow collector: 192.168.67.100, listening
on UDP port 2055

Task 1: Configure Basic Addressing

Configure R1's LAN interface.

Task 2: Configure a Flow Exporter

Define a flow exporter pointing to the collector's address and port.

Task 3: Configure a Flow Monitor

Create a flow monitor using standard IPv4 flow tracking, referencing the exporter.

Task 4: Apply the Flow Monitor to the Interface

Apply the flow monitor to Gi0/0 for both directions of traffic.

Task 5: Generate Traffic and Verify Flow Records

Generate traffic through the interface and confirm flow statistics are being collected locally, then verify the collector receives exported records.

Solution and Verification

R1(config)# interface gigabitethernet0/0
R1(config-if)# ip address 192.168.67.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

R1(config)# flow exporter MY-EXPORTER
R1(config-flow-exporter)# destination 192.168.67.100
R1(config-flow-exporter)# transport udp 2055

R1(config)# flow monitor MY-MONITOR
R1(config-flow-monitor)# exporter MY-EXPORTER
R1(config-flow-monitor)# record netflow ipv4 original-input

R1(config)# interface gigabitethernet0/0
R1(config-if)# ip flow monitor MY-MONITOR input
R1(config-if)# ip flow monitor MY-MONITOR output

PC-A> curl http://93.184.216.34
PC-A> ping 192.168.67.50

R1# show flow monitor MY-MONITOR cache

SrcAddr        DstAddr         SrcPort  DstPort  Bytes  Packets
192.168.67.10  93.184.216.34   52341    80       1284   9
192.168.67.10  192.168.67.50   0        0        420    5
-- Locally cached flow records already reflect
-- the generated traffic accurately, before
-- even confirming export succeeded

-- On the collector (conceptual verification):

Collector received flow record:
  Source: 192.168.67.10:52341
  Destination: 93.184.216.34:80
  Protocol: TCP
  Bytes: 1284
-- Matches exactly what the local cache showed

Key Takeaway

Unlike SPAN's complete packet mirroring, NetFlow produces compact summary records rather than full packet copies, making it practical to monitor traffic patterns across an entire network's worth of interfaces continuously without the storage and bandwidth overhead that mirroring every packet would require — the trade-off is losing full packet content, useful for volume and pattern analysis but not for the deep protocol-level inspection SPAN provides.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه