1 | % Netdot exercise |
---|
2 | % Network Management Topics |
---|
3 | |
---|
4 | # Introduction |
---|
5 | |
---|
6 | The Network Documentation Tool (Netdot) is an open source tool designed to |
---|
7 | help network administrators collect, organize and maintain network |
---|
8 | documentation. Netdot is actively developed at the University of Oregon. |
---|
9 | |
---|
10 | ## Goals |
---|
11 | |
---|
12 | In these exercises we will install Netdot and demonstrate some of its most |
---|
13 | important 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 | |
---|
28 | Some 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 \ |
---|
33 | graphviz libmodule-build-perl libcgi-pm-perl libclass-dbi-perl \ |
---|
34 | libclass-dbi-abstractsearch-perl libapache2-request-perl libhtml-mason-perl \ |
---|
35 | libapache-session-perl liburi-perl libsql-translator-perl libsnmp-info-perl \ |
---|
36 | snmp-mibs-downloader libnetaddr-ip-perl liblog-dispatch-perl \ |
---|
37 | liblog-log4perl-perl libparallel-forkmanager-perl libauthen-radius-perl \ |
---|
38 | libtest-simple-perl libtime-local-perl libfile-spec-perl libnet-dns-perl \ |
---|
39 | libcarp-assert-perl libdigest-sha-perl libssl-dev dnssec-tools \ |
---|
40 | libsocket6-perl libxml-simple-perl mysql-server libdbix-datasource-perl |
---|
41 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
42 | |
---|
43 | (If you had not installed mysql-server, you'll be asked for a DBA password. |
---|
44 | Use the password that you used to log in to the PC). |
---|
45 | |
---|
46 | Now we'll set up APT to look for the rest of the packages in NSRC's server. |
---|
47 | |
---|
48 | Add the following file: |
---|
49 | |
---|
50 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
51 | $ cd /etc/apt/sources.list.d |
---|
52 | $ sudo EDITOR netdot.apt.nsrc.org.list |
---|
53 | |
---|
54 | Add these two lines: |
---|
55 | |
---|
56 | deb http://netdot.apt.nsrc.org/ unstable/ |
---|
57 | deb-src http://netdot.apt.nsrc.org/ unstable/ |
---|
58 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
59 | |
---|
60 | (save and exit editor) |
---|
61 | |
---|
62 | Now install the rest of the packages: |
---|
63 | |
---|
64 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
65 | $ sudo apt-get update |
---|
66 | $ sudo apt-get -y --force-yes install libapache2-authcookie-perl \ |
---|
67 | libapache2-sitecontrol-perl libnet-iptrie-perl libnet-irr-perl \ |
---|
68 | libnet-appliance-session-perl libbind-config-parser-perl |
---|
69 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
70 | |
---|
71 | Update the following file: |
---|
72 | |
---|
73 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
74 | $ sudo EDITOR /etc/snmp/snmp.conf |
---|
75 | |
---|
76 | comment out this line: |
---|
77 | |
---|
78 | mibs: |
---|
79 | |
---|
80 | to that it becomes: |
---|
81 | |
---|
82 | #mibs: |
---|
83 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
84 | |
---|
85 | (save and exit) |
---|
86 | |
---|
87 | Download the latest Netdot package: |
---|
88 | |
---|
89 | First check if it's available in your classroom's NOC server: |
---|
90 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
91 | $ cd /usr/local/src |
---|
92 | $ sudo wget http://noc.ws.nsrc.org/downloads/netdot-latest.tar.gz |
---|
93 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
94 | |
---|
95 | If not, try from the official site: |
---|
96 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
97 | $ sudo wget --no-check-certificate \ |
---|
98 | https://netdot.uoregon.edu/pub/dists/netdot-0.9.10.tar.gz |
---|
99 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
100 | |
---|
101 | Unpack the tarball: |
---|
102 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
103 | $ sudo tar xzvf netdot-0.9.10.tar.gz |
---|
104 | $ cd netdot-0.9.10.tar.gz |
---|
105 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
106 | |
---|
107 | Verify that we have all the necessary dependencies: |
---|
108 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
109 | $ make testdeps |
---|
110 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
111 | |
---|
112 | Initialize the site configuration: |
---|
113 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
114 | $ sudo cp etc/Default.conf etc/Site.conf |
---|
115 | $ sudo EDITOR etc/Site.conf |
---|
116 | |
---|
117 | Find and change the following values: |
---|
118 | |
---|
119 | NETDOTNAME => 'pcX.ws.nsrc.org' |
---|
120 | DB_DBA_PASSWORD => '(the password you used when installing mysql)', |
---|
121 | DEFAULT_SNMPCOMMUNITIES => ['NetManage', 'public'], |
---|
122 | NMS_DEVICE => 'localhost', |
---|
123 | DEFAULT_DNSDOMAIN => 'ws.nsrc.org', |
---|
124 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
125 | |
---|
126 | Install the application and initialize the database |
---|
127 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
128 | $ sudo make install APACHEUSER=www-data APACHEGROUP=www-data |
---|
129 | $ sudo make installdb |
---|
130 | $ sudo ln -s /usr/local/netdot/etc/netdot_apache2_local.conf \ |
---|
131 | /etc/apache2/conf.d/ |
---|
132 | $ sudo service apache2 graceful |
---|
133 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
134 | |
---|
135 | Install the cron jobs for automated tasks |
---|
136 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
137 | $ sudo cp netdot.cron /etc/cron.d/netdot |
---|
138 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
139 | |
---|
140 | # Operation |
---|
141 | |
---|
142 | ## Log into the web interface |
---|
143 | |
---|
144 | In your browser, go to: |
---|
145 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
146 | http://pcX.ws.nsrc.org/netdot |
---|
147 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
148 | |
---|
149 | Log in with admin/admin |
---|
150 | |
---|
151 | ## Changing default passwords |
---|
152 | |
---|
153 | Netdot comes with three default user accounts. You should change the default |
---|
154 | passwords on those. |
---|
155 | |
---|
156 | Go to the "Contacts" tab, then search for "Admin". You should see the details |
---|
157 | for the Admin user. Click on [edit], and find the Password field. Type the |
---|
158 | password you used to log in to your PC, then click on the "Update" button. |
---|
159 | |
---|
160 | Repeat the same steps for the other default users: |
---|
161 | |
---|
162 | * operator |
---|
163 | * guest |
---|
164 | |
---|
165 | ## Discovering devices |
---|
166 | |
---|
167 | If you have not done so yet, configure SNMP on your PC and your router. |
---|
168 | |
---|
169 | Let's create a file with all the devices in the lab network that respond |
---|
170 | to SNMP: |
---|
171 | |
---|
172 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
173 | $sudo EDITOR /home/sysadm/discoverme.txt |
---|
174 | |
---|
175 | Copy and paste the following list: |
---|
176 | |
---|
177 | gw.ws.nsrc.org NetManage |
---|
178 | sw.ws.nsrc.org NetManage |
---|
179 | rtr1.ws.nsrc.org NetManage |
---|
180 | rtr2.ws.nsrc.org NetManage |
---|
181 | rtr3.ws.nsrc.org NetManage |
---|
182 | rtr4.ws.nsrc.org NetManage |
---|
183 | rtr5.ws.nsrc.org NetManage |
---|
184 | rtr6.ws.nsrc.org NetManage |
---|
185 | pc1.ws.nsrc.org NetManage |
---|
186 | pc2.ws.nsrc.org NetManage |
---|
187 | pc3.ws.nsrc.org NetManage |
---|
188 | pc4.ws.nsrc.org NetManage |
---|
189 | pc5.ws.nsrc.org NetManage |
---|
190 | pc6.ws.nsrc.org NetManage |
---|
191 | pc7.ws.nsrc.org NetManage |
---|
192 | pc8.ws.nsrc.org NetManage |
---|
193 | pc9.ws.nsrc.org NetManage |
---|
194 | pc10.ws.nsrc.org NetManage |
---|
195 | pc11.ws.nsrc.org NetManage |
---|
196 | pc12.ws.nsrc.org NetManage |
---|
197 | pc13.ws.nsrc.org NetManage |
---|
198 | pc14.ws.nsrc.org NetManage |
---|
199 | pc15.ws.nsrc.org NetManage |
---|
200 | pc16.ws.nsrc.org NetManage |
---|
201 | pc17.ws.nsrc.org NetManage |
---|
202 | pc18.ws.nsrc.org NetManage |
---|
203 | pc19.ws.nsrc.org NetManage |
---|
204 | pc20.ws.nsrc.org NetManage |
---|
205 | pc21.ws.nsrc.org NetManage |
---|
206 | pc22.ws.nsrc.org NetManage |
---|
207 | pc23.ws.nsrc.org NetManage |
---|
208 | pc24.ws.nsrc.org NetManage |
---|
209 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
210 | |
---|
211 | Now, tell Netdot to discover those devices: |
---|
212 | |
---|
213 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
214 | $ cd /usr/local/netdot |
---|
215 | $ bin/updatedevices.pl -E /home/sysadm/discoverme.txt -IAF |
---|
216 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
217 | |
---|
218 | Go to the web interface and navigate to |
---|
219 | |
---|
220 | Management -> Devices |
---|
221 | |
---|
222 | In the search box, type "*", and hit ENTER |
---|
223 | |
---|
224 | You should see discovered devices in that list. Go to the link for your |
---|
225 | group's router (e.g. rtrX.ws.nsrc.org) |
---|
226 | |
---|
227 | * Navigate to all the tabs: Basic, Interfaces, Modules, IP Info, etc. |
---|
228 | * In the ARP section, you should see one entry with a timestamp. |
---|
229 | Click on that entry. You should see a table associating IP addresses |
---|
230 | and MAC addresses. This is the ARP table discovered from rtr1. You should |
---|
231 | see your PC's IP address and MAC address. |
---|
232 | |
---|
233 | ## Finding a computer in your network |
---|
234 | |
---|
235 | * Obtain the MAC address from your laptop (or desktop). |
---|
236 | * In the Netdot web interface, go to Management -> Devices |
---|
237 | * Type (or paste) your MAC address and hit ENTER |
---|
238 | |
---|
239 | Netdot will show you which devices were seeing that MAC address the last |
---|
240 | time that it discovered the network. |
---|
241 | |
---|
242 | ## Managing IP address space |
---|
243 | |
---|
244 | Go to Management -> Address Space |
---|
245 | |
---|
246 | You should see a list of private IP blocks (from RFC-1918). These come |
---|
247 | pre-installed in Netdot. |
---|
248 | |
---|
249 | Click on 10.10.0.0/8 |
---|
250 | |
---|
251 | You will see a list of discovered IP blocks, which are marked as "Subnets". |
---|
252 | These were found in routers. |
---|
253 | |
---|
254 | ### Create a container to include all the group subnets |
---|
255 | |
---|
256 | In the section called "Address Space Tasks" on top, click on the "[new]" |
---|
257 | button and enter the following: |
---|
258 | |
---|
259 | * IP/Prefix: 10.10.0.0/16 |
---|
260 | * Owner: click on [new]. |
---|
261 | * In the new "Entity" window, enter: |
---|
262 | * Name: NSRC Lab |
---|
263 | * Insert button, then [close] |
---|
264 | * Used by: (leave blank) |
---|
265 | * Status: Container |
---|
266 | * Description: NSRC lab student networks |
---|
267 | * Save button |
---|
268 | |
---|
269 | You should now see the new Container page. It shows a graphical representation |
---|
270 | of the /16 block. All the existing subnets are shown in red. The green space |
---|
271 | represents unused or available address space. |
---|
272 | |
---|
273 | |
---|
274 | # More information |
---|
275 | |
---|
276 | [Official Netdot Website](http://netdot.uoregon.edu) |
---|
277 | |
---|
278 | |
---|
279 | |
---|