Agenda: exercise1-flow-export.txt

File exercise1-flow-export.txt, 6.3 KB (added by carmas, 6 years ago)

Exercise1-NfSen?

Line 
1% Monitoring Netflow with NfSen
2%
3% Network Monitoring and Management
4
5# Introduction
6
7## Goals
8
9* Learn how to export flows from a Cisco router
10
11## Notes
12
13* Commands preceded with "$" imply that you should execute the command as
14  a general user - not as root.
15* Commands preceded with "#" imply that you should be working as root.
16* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>")
17  imply that you are executing commands on remote equipment, or within
18  another program.
19
20# Export flows from a Cisco router
21
22During this exercise we will ask that you export flows from your router to two
23PCs in the classroom. You should work together as a group. That is, for group 1,
24users of pc1, pc2, pc3, pc4 should work together and pick one machine where
25network flows will arrive.
26
27In addition, you will export a second flow from your group's router to a PC in
28the group next to yours. That is, for example, if group 2 has chosen pc5 to be
29the PC that receives flows, then the second flow you export will go to pc5. And,
30if you chose pc1 to receive flows from router 1 (rtr1), then it should, also,
31receive flows from router 2 (rtr2):
32
33These exercises work on the example of doing the following:
34
35Group 1, Router 1
36-----------------
37rtr1 ==> pc1 on port 9001
38rtr1 ==> pc5 on port 9002
39
40Group 2, Router 2
41-----------------
42rtr2 ==> pc5 on port 9001
43rtr2 ==> pc1 on port 9002
44
45You may select the combination that works for your groups.
46
47Here are the groups that should work together:
48
49* group 1 and 2
50* group 3 and 4
51* group 5 and 6
52* group 7 and 8
53
54If there is a group 9 please see the instructors.
55
56~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57$ ssh cisco@rtr1.ws.nsrc.org
58rtr1.ws.nsrc.org> enable
59~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
61or, if ssh is not configured yet:
62
63~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64$ telnet 10.10.1.54
65Username: cisco
66Password:
67Router1>enable
68Password:
69~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70
71Remember - This is an EXAMPLE for the following situation:
72
73rtr1 ==> pc1 on port 9001
74rtr1 ==> pc5 on port 9002
75
76Group 2, 3, 4, 5, 6, 7, 8 and 9 will do something different.
77
78The following configures the FastEthernet 0/0 interface to export flows.
79
80~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81rtr1.ws.nsrc.org# configure terminal
82rtr1.ws.nsrc.org(config)# interface FastEthernet 0/0
83rtr1.ws.nsrc.org(config-if)# ip flow ingress
84rtr1.ws.nsrc.org(config-if)# ip flow egress
85rtr1.ws.nsrc.org(config-if)# exit
86rtr1.ws.nsrc.org(config)# ip flow-export destination 10.10.1.1 9001
87rtr1.ws.nsrc.org(config)# ip flow-export destination 10.10.2.5 9002
88rtr1.ws.nsrc.org(config)# ip flow-export version 5
89rtr1.ws.nsrc.org(config)# ip flow-cache timeout active 5
90~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91
92This breaks up long-lived flows into 5-minute fragments. You can
93choose any number of minutes between 1 and 60. If you leave it at
94the default of 30 minutes your traffic reports will have spikes.
95
96~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97rtr1.ws.nsrc.org(config)# snmp-server ifindex persist
98~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
100This enables ifIndex persistence globally. This ensures that the
101ifIndex values are retained during router reboots - also if you add
102or remove interface modules to your network devices.
103
104Now configure how you want the ip flow top-talkers to work:
105
106~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107rtr1.ws.nsrc.org(config)#ip flow-top-talkers
108rtr1.ws.nsrc.org(config-flow-top-talkers)#top 20
109rtr1.ws.nsrc.org(config-flow-top-talkers)#sort-by bytes
110rtr1.ws.nsrc.org(config-flow-top-talkers)#end
111~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112 
113Now we'll verify what we've done.
114
115~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116rtr1.ws.nsrc.org# show ip flow export
117rtr1.ws.nsrc.org# show ip cache flow
118~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119
120See your "top talkers" across your router interfaces
121
122~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123rtr1.ws.nsrc.org# show ip flow top-talkers
124~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
125
126If it all looks good then write your running-config to non-volatile
127RAM (i.e. the startup-config):
128
129~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130rtr1.ws.nsrc.org#wr mem
131~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132   
133You can exit from the router now:
134
135~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136rtr1.ws.nsrc.org#exit
137~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138   
139Verify that flows are arriving from your router to the PC chosen to receive
140flows in your group:
141
142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143$ sudo tcpdump -Tcnfp port 9001
144~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145
146Wait a few seconds and you should see something that looks like:
147
14806:12:00.953450 IP s2.ws.nsrc.org.54538 > noc.ws.nsrc.org.9009: NetFlow v5, 9222.333 uptime, 1359871921.013782000, #906334, 30 recs
149  started 8867.952, last 8867.952
150    10.10.0.241/0:0:53 > 10.10.0.250/0:0:49005 >> 0.0.0.0
151    udp tos 0, 1 (136 octets)
152  started 8867.952, last 3211591.733
153    10.10.0.241/10:0:0 > 0.0.0.0/10:0:4352 >> 0.0.0.0
154    ip tos 0, 62 (8867952 octets)
155[...]
156
157If you are using Netflow v9, do note that the above output may not be
158correct, as the tcpdump in this version of Ubuntu does not decode Netflow
159v9 properly.
160
161Verify that flows are arriving from the router in the group next to you to
162the PC chosen to receive flows in your group (you may have to wait until
163the group next to you is ready and exporting flows to your PC):
164
165~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166$ sudo tcpdump -Tcnfp port 9002
167~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168
169You are done for this lab.
170
171Move on to exercise3-NfSen-PortTracker if NfSen is already installed.
172
173Otherwise, go to exercise2-install-nfdump-nfsen.