LAB 24_ Implement Flexible NetFlow
LAB 24_ Implement Flexible NetFlow
Topology
Addressing Table
Device Interface IP Address IPv6 Address IPv6 Link Local
R1
Loopback0 10.0.0.1/24 2001:db8:acad:10::1/64 fe80::1:2
D1 VLAN 1 192.168.1.2/24 2001:db8:acad:1000::2/64 fe80::d1:1
A1 VLAN 1 192.168.1.3/24 2001:db8:acad:1000::3/64 fe80::a1:1
PC1 NIC 192.168.1.50/24 2001:db8:acad:1000::50/64 EUI-64
PC2 NIC 192.168.1.75/24 Assigned by SLAAC EUI-64
Objectives
Part 1: Build the Network and Configure Basic Device Settings and Interface Addressing
Part 2: Configure and Verify Flexible Netflow
Part 3: (Optional) Configure and Verify Netflow
Background / Scenario
NetFlow is a Cisco IOS technology that provides statistics on packets flowing through the router. NetFlow is
the standard for acquiring IP operational data from IP networks. NetFlow provides data to enable network and
security monitoring, network planning, traffic analysis, and IP accounting.
Flexible NetFlow improves on original NetFlow by adding the capability to customize the traffic analysis
parameters for your specific requirements. Flexible NetFlow facilitates the creation of more complex
configurations for traffic analysis and data export through the use of reusable configuration components.
Note: This lab is an exercise in configuring options available for Flexible Netflow and does not necessarily
reflect network troubleshooting best practices.
Page 1 of 12
Lab - Implement Flexible Netflow
Note: The routers used with CCNP hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.4
(universalk9 image). The switches used in the labs are Cisco Catalyst 3650s with Cisco IOS XE Release
16.9.4 (universalk9 image) and Cisco Catalyst 2960s with Cisco IOS Release 15.2(2) (lanbasek9 image).
Other routers, switches, and Cisco IOS versions can be used. Depending on the model and Cisco IOS
version, the commands available and the output produced might vary from what is shown in the labs. Refer to
the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: IOS XE does not support classic Netflow. If your lab has ISR G2 series routers, skip Part 2 of this lab
and do Part 3, which covers classic Netflow.
Note: Make sure that the switches have been erased and have no startup configurations. If you are unsure,
contact your instructor.
Note: The default Switch Database Manager (SDM) template on a Catalyst 2960 does not support IPv6. You
must change the default SDM template to the dual-ipv4-and-ipv6 default template using the sdm prefer dual-
ipv4-and-ipv6 default global configuration command. Changing the template will require a reboot.
Required Resources
• 1 Router (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
• 1 Switch (Cisco 3650 with Cisco IOS XE Release 16.9.4 universal image or comparable)
• 1 Switch (Cisco 2960 with Cisco IOS Release 15.2(2) lanbasek9 image or comparable)
• 2 PCs (Choice of operating system with terminal emulation program and a packet capture utility installed,
such as Wireshark)
• Console cables to configure the Cisco IOS devices via the console ports
• Ethernet cables as shown in the topology
Instructions
Part 1: Build the Network and Configure Basic Device Settings and Interface
Addressing
In Part 1, you will set up the network topology and configure basic settings and interface addressing on
routers.
Page 2 of 12
Lab - Implement Flexible Netflow
line vty 0 4
privilege level 15
exec-timeout 0 0
password cisco123
login
exit
interface g0/0/1
ip address 192.168.1.1 255.255.255.0
ipv6 address fe80::1:1 link-local
ipv6 address 2001:db8:acad:1000::1/64
no shutdown
exit
interface loopback 0
ip address 10.0.0.1 255.255.255.0
ipv6 address fe80::1:2 link-local
ipv6 address 2001:db8:acadd:10::1/64
no shutdown
exit
ntp master 3
end
Switch D1
hostname D1
no ip domain lookup
ipv6 unicast-routing
banner motd # D1, Implement Flexible Netflow #
line con 0
exec-timeout 0 0
logging synchronous
exit
line vty 0 4
privilege level 15
exec-timeout 0 0
password cisco123
login
exit
interface vlan 1
ip address 192.168.1.2 255.255.255.0
ipv6 address fe80::d1:1 link-local
ipv6 address 2001:db8:acad:1000::2/64
no shutdown
exit
ip default-gateway 192.168.1.1
interface g1/0/23
spanning-tree portfast
switchport mode access
Page 3 of 12
Lab - Implement Flexible Netflow
no shutdown
exit
interface g1/0/11
spanning-tree portfast
switchport mode access
no shutdown
exit
interface range g1/0/5-6
switchport mode trunk
channel-group 1 mode active
no shutdown
exit
interface range g1/0/1-4, g1/0/7-10, g1/0/12-22, g1/0/24, g1/1/1-4
shutdown
exit
ntp server 192.168.1.1
end
Switch A1
hostname A1
no ip domain lookup
ipv6 unicast-routing
banner motd # A1, Implement Flexible Netflow #
line con 0
exec-timeout 0 0
logging synchronous
exit
line vty 0 4
privilege level 15
exec-timeout 0 0
password cisco123
login
exit
interface vlan 1
ip address 192.168.1.3 255.255.255.0
ipv6 address fe80::a1:1 link-local
ipv6 address 2001:db8:acad:1000::3/64
no shutdown
exit
ip default-gateway 192.168.1.1
interface range f0/1-2
switchport mode trunk
channel-group 1 mode active
no shutdown
exit
interface f0/23
Page 4 of 12
Lab - Implement Flexible Netflow
2) Set up the flow record to match ipv4 destination address and transport destination.
R1(config-flow-record)# match ipv4 destination address
R1(config-flow-record)# match transport destination-port
3) Set up the flow record to collect bytes and packets.
R1(config-flow-record)# collect counter bytes
R1(config-flow-record)# collect counter packets
4) Use the show flow record CCNP8-CUSTOM-OUT command to examine the results.
Page 5 of 12
Lab - Implement Flexible Netflow
Page 6 of 12
Lab - Implement Flexible Netflow
b. Create the second flow monitor and name it CCNP8-OUTBOUND-MONITOR using the flow monitor
CCNP8-OUTBOUND-MONITOR command. As part of the flow monitor, specify that it will record the
CCNP8-CUSTOM-OUT flow record, export the cache to the exporter every 30 seconds, and identify
CCNP8-COLLECTOR-HOST as the exporter.
R1(config)# flow monitor CCNP8-OUTBOUND-MONITOR
R1(config-flow-monitor)# record CCNP8-CUSTOM-OUT
R1(config-flow-monitor)# cache timeout active 30
R1(config-flow-monitor)# exporter CCNP8-COLLECTOR-HOST
R1(config-flow-monitor)# exit
c. Use the show flow monitor command to examine the results.
R1# show flow monitor
Flow Monitor CCNP8-INBOUND-MONITOR:
Description: User defined
Flow Record: netflow ipv4 original-input
Flow Exporter: CCNP8-COLLECTOR-HOST
Cache:
Type: normal (Platform cache)
Status: not allocated
Size: 200000 entries
Inactive Timeout: 15 secs
Active Timeout: 30 secs
Trans end aging: off
Page 7 of 12
Lab - Implement Flexible Netflow
a. From PC2, start a continuous ping to R1 using IPv4 and IPv6. As a part of each set of ping parameters,
set the size of the packets to 1475 bytes.
The windows commands are as follows:
C:\> ping 10.0.0.1 -t -l 1475
C:\> ping 2001:db8:acad:1000::1 -t -l 1475
b. From switch A1, telnet to R1. Login and leave the session running.
c. From switch D1, use the extended ping utility to send pings to R1 Loopback 0 using a sweep range of 36
bytes to 18024 bytes. Set the repeat count to 1,000,000 and the sweep interval to 1.
D1# ping
Protocol [ip]:
Target IP address: 10.0.0.1
Repeat count [5]: 100000
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Ingress ping [n]:
Source address or interface:
DSCP Value [0]:
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0x0000ABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]: y
Sweep min size [36]:
Sweep max size [18024]:
Sweep interval [1]:
Type escape sequence to abort.
Sending 89945, [36..18024]-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
d. On PC1, start Wireshark and apply the filter ip.src == 192.168.1.1 && udp.dstport == 9999 && ! icmp.
This filters the display to show packets from 192.168.1.1 destined for UDP port 9999 and not ICMP
packets.
Page 8 of 12
Lab - Implement Flexible Netflow
c. On R1, issue the command show flow monitor CCNP8-INBOUND-MONITOR cache. Note: Output will
vary depending upon how long within the 30-second window traffic has been caching.
R1# show flow monitor CCNP8-INBOUND-MONITOR cache
Cache type: Normal (Platform cache)
Cache size: 200000
Current entries: 1
High Watermark: 12
Page 9 of 12
Lab - Implement Flexible Netflow
Page 10 of 12
Lab - Implement Flexible Netflow
b. Issue the command show ip flow export to show the collection host IP address and how many flows
have been exported.
R1# show ip flow export
Flow export v9 is enabled for main cache
Export source and destination details :
VRF ID : Default
Destination(1) 192.168.1.50 (9999)
Version 9 flow records
117 flows exported in 55 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
0 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
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608
.012 .012 .012 .172 .355 .000 .000 .000 .000 .000 .000
Page 11 of 12
Lab - Implement Flexible Netflow
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many
interfaces the router has. There is no way to effectively list all the combinations of configurations for each router
class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device.
The table does not include any other type of interface, even though a specific router may contain one. An
example of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be
used in Cisco IOS commands to represent the interface.
End of document
Page 12 of 12