AgendaTrack1: exercises-netdot.txt

File exercises-netdot.txt, 11.4 KB (added by admin, 7 years ago)
Line 
1% Netdot exercise
2% Network Management Topics
3
4# Introduction
5
6The Network Documentation Tool (Netdot) is an open source tool designed to
7help network administrators collect, organize and maintain network
8documentation. Netdot is actively developed at the University of Oregon.
9
10## Goals
11
12In these exercises we will install Netdot and demonstrate some of its most
13important features.
14
15## Notes
16
17* Commands preceded with "$" imply that you should execute the command as
18  a general user - not as root.
19* Commands preceded with "#" imply that you should be working as root.
20* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>")
21  imply that you are executing commands on remote equipment, or within
22  another program.
23
24# Installation
25
26## Package Dependencies
27
28Some packages are available in Ubuntu. We'll install those first
29(you will probably want to copy/paste the following):
30
31~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32$ sudo apt-get -y install apache2 libapache2-mod-perl2 rrdtool librrds-perl \
33graphviz libmodule-build-perl libcgi-pm-perl libclass-dbi-perl \
34libclass-dbi-abstractsearch-perl libapache2-request-perl libhtml-mason-perl \
35libapache-session-perl liburi-perl libsql-translator-perl libsnmp-info-perl \
36libnetaddr-ip-perl liblog-dispatch-perl liblog-log4perl-perl \
37libparallel-forkmanager-perl libauthen-radius-perl  libtest-simple-perl \
38libtime-local-perl libfile-spec-perl libnet-dns-perl  libcarp-assert-perl \
39libdigest-sha-perl libssl-dev dnssec-tools libsocket6-perl libxml-simple-perl \
40mysql-server libdbix-datasource-perl
41~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
43(If you had not installed mysql-server, you'll be asked for a DBA password.
44Use the password that you used to log in to the PC).
45
46Download the latest Netdot package:
47
48First check if it's available in your classroom's NOC server:
49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50$ cd /usr/local/src
51$ sudo wget http://noc.ws.nsrc.org/downloads/netdot-0.9.10.tar.gz
52~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
54If not, try from the official site:
55~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56$ sudo wget --no-check-certificate \
57https://netdot.uoregon.edu/pub/dists/netdot-0.9.10.tar.gz
58~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59
60Unpack the tarball:
61~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62$ sudo tar xzvf netdot-0.9.10.tar.gz
63$ cd netdot-0.9.10
64~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
66Install remaining  dependencies:
67
68~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69$ sudo make installdeps
70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
72Verify that we have all the necessary dependencies:
73
74~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75$ make testdeps
76~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77
78Initialize the site configuration:
79~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80$ sudo cp etc/Default.conf etc/Site.conf
81$ sudo EDITOR etc/Site.conf
82
83  Find and change the following values:
84
85NETDOTNAME => 'pcX.ws.nsrc.org'
86DB_DBA_PASSWORD => '(the password you used when installing mysql)',
87DEFAULT_SNMPCOMMUNITIES  =>  ['NetManage', 'public'],
88NMS_DEVICE => 'localhost',
89DEFAULT_DNSDOMAIN  => 'ws.nsrc.org',
90DEVICE_NAMING_METHOD_ORDER => [ 'snmp_target', 'sysname' ],
91~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93Install the application and initialize the database
94~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95$ sudo make install APACHEUSER=www-data APACHEGROUP=www-data
96$ sudo make installdb
97$ sudo ln -s /usr/local/netdot/etc/netdot_apache2_local.conf \
98/etc/apache2/conf.d/
99$ sudo service apache2 graceful
100~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
102Install the cron jobs for automated tasks
103~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104$ sudo cp netdot.cron /etc/cron.d/netdot
105~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106
107# Operation
108
109## Log into the web interface
110
111In your browser, go to:
112~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113http://pcX.ws.nsrc.org/netdot
114~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
116Log in with admin/admin
117
118## Changing default passwords
119
120Netdot comes with three default user accounts. You should change the default
121passwords on those.
122
123Go to the "Contacts" tab, then search for "Admin". You should see the details
124for the Admin user. Click on [edit], and find the Password field. Type the
125password you used to log in to your PC, then click on the "Update" button.
126
127Repeat the same steps for the other default users:
128
129* operator
130* guest
131
132## Discovering devices
133
134If you have not done so yet, configure SNMP on your PC and your router.
135
136* See Apendix A for instructions on configurin the Linux SNMP agent
137* See Apendix B for instructions on configuring SNMP on a Cisco router
138
139Now back to Netdot. Let's create a file with all the devices in the lab network
140that respond to SNMP:
141
142~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143$ sudo EDITOR /home/sysadm/discoverme.txt
144
145Copy and paste the following list:
146
147gw.ws.nsrc.org NetManage
148sw.ws.nsrc.org NetManage
149rtr1.ws.nsrc.org NetManage
150rtr2.ws.nsrc.org NetManage
151rtr3.ws.nsrc.org NetManage
152rtr4.ws.nsrc.org NetManage
153rtr5.ws.nsrc.org NetManage
154rtr6.ws.nsrc.org NetManage
155pc1.ws.nsrc.org NetManage
156pc2.ws.nsrc.org NetManage
157pc3.ws.nsrc.org NetManage
158pc4.ws.nsrc.org NetManage
159pc5.ws.nsrc.org NetManage
160pc6.ws.nsrc.org NetManage
161pc7.ws.nsrc.org NetManage
162pc8.ws.nsrc.org NetManage
163pc9.ws.nsrc.org NetManage
164pc10.ws.nsrc.org NetManage
165pc11.ws.nsrc.org NetManage
166pc12.ws.nsrc.org NetManage
167pc13.ws.nsrc.org NetManage
168pc14.ws.nsrc.org NetManage
169pc15.ws.nsrc.org NetManage
170pc16.ws.nsrc.org NetManage
171pc17.ws.nsrc.org NetManage
172pc18.ws.nsrc.org NetManage
173pc19.ws.nsrc.org NetManage
174pc20.ws.nsrc.org NetManage
175pc21.ws.nsrc.org NetManage
176pc22.ws.nsrc.org NetManage
177pc23.ws.nsrc.org NetManage
178pc24.ws.nsrc.org NetManage
179~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180
181Now, tell Netdot to discover those devices:
182
183~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184$ cd /usr/local/netdot
185$ sudo bin/updatedevices.pl -E /home/sysadm/discoverme.txt -IAF
186~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187
188When that is done, go to the web interface and navigate to
189
190Management -> Devices
191
192In the search box, type "*", and hit ENTER
193
194You should see discovered devices in that list. Go to the link for your
195group's router (e.g. rtrX.ws.nsrc.org)
196
197* Navigate to all the tabs: Basic, Interfaces, Modules, IP Info, etc.
198  Netdot allows you to augment the information gathered from the device
199  with details entered manually.
200
201* In the ARP section, you should see one entry with a timestamp.
202  Click on that entry. You should see a table associating IP addresses
203  with MAC addresses. This is the ARP table discovered from rtr1. You should
204  see your PC's IP address and MAC address.
205
206## Finding a computer in your network
207
208* Obtain the MAC address from your laptop (or desktop)
209* In the Netdot web interface, go to Management -> Devices
210* Type (or paste) your MAC address and hit ENTER
211
212Netdot will show you which devices were seeing that MAC address the last
213time that it discovered the network.
214
215## Managing IP address space
216
217Go to Management -> Address Space
218
219You should see a list of private IP blocks (from RFC-1918). These come
220pre-installed in Netdot.
221
222Click on 10.10.0.0/8
223
224You will see a list of discovered IP blocks, which are marked as "Subnets".
225These were found in routers.
226
227* Click on 10.10.1.0/24.
228* Click on [edit]
229* In the Description field, type "Group 1 PCs"
230* Click "Save"
231
232### Create a container to include all the group subnets
233
234In the section called "Address Space Tasks" on top, click on the "[new]"
235button and enter the following:
236
237* IP/Prefix: 10.10.0.0/16
238* Owner: click on [new].
239* In the new "Entity" window, enter:
240  * Name: NSRC Lab
241  * Insert button, then [close]
242* Used by: (leave blank)
243* Status: Container
244* Description: NSRC lab student networks
245* Save button
246
247You should now see the new Container page. It shows a graphical representation
248of the /16 block. All the existing subnets are shown in red. The green space
249represents unused or available address space.
250
251* On the top of the graph there is a section called "Zoom: set one row equal to"
252  Select /24 from the drop-down menu. Each row now represents a /24 block
253* Click on [tree view] to see a tree graph view of the IP hierarchy
254
255# More information
256
257[Official Netdot Website](http://netdot.uoregon.edu)
258
259# Apendix A
260
261## Install and configure an SNMP agent on your Linux PC
262
263~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264$ sudo apt-get install snmp snmpd
265~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266
267Configure the agent. First, make a copy of the distributed config file:
268
269~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270$ sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.dist
271~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272
273And create a new simple configuration:
274
275~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276$ sudo EDITOR /etc/snmp/snmpd.conf
277
278  And add the following lines:
279
280syslocation My University
281syscontact  Network Services (nethelp@mydomain.com)
282sysservices 72
283rocommunity  NetManage
284~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285
286And then restart the daemon:
287
288~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
289$ sudo service snmpd restart
290~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
292Test it:
293
294~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295$ snmpwalk -v2c -c NetManage localhost system
296~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297
298You should get some system information
299
300
301\pagebreak
302
303
304# Appendix B
305
306## Configuring SNMP on your Cisco router
307
308Connect to the router. Substitute X for your group number:
309
310(your instructor will provide the username and password)
311
312~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313$ ssh rtrX.ws.nsrc.org -l <username>
314~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315
316If SSH is not configured on the router, you may need to use telnet:
317
318~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319$ telnet rtrX.ws.nsrc.org
320~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321
322* Note: Never use telnet on a production network!
323
324Then configure SNMP like this:
325
326~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327# configure terminal
328# snmp-server community NetManage
329# end
330# write memory
331# exit
332~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333
334Now test it:
335
336~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
337$ snmpwalk -v2c -c NetManage rtrX.ws.nsrc.org system
338~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
339
340
341