Generally, people these days think managing routers is synonymous with SNMP. But the Cisco Networkers slides have a nice perspective on that: managing at the low end can involve things like configuring via telnet, show and debug commands, TFTP for configuration and downloading IOS updates to flash. Not to be a Cisco cheerleader, but Cisco routers really do have a wide variety of features that lend themselves well to managing the network. (How easy is it to configure the brand X router with the menu or MS Windows GUI , when you have to work across a modem dial-up link because your network is broken?) It's easy to overlook these features, and we shouldn't forget them. (But we're going to, for the remainder of this article).
Until you do this for the first time, you can't use CiscoWorks to configure the routers in a group (it needs SNMP read-write access).
If you're working with a UNIX platform for network management, as most people are, you can use the EXPECT language to assist you. If you have CiscoWorks 2.x, you already have the EXPECT interpreter. Otherwise, it's freeware you can pick up from the usual archive sites (like ftp.uu.net). You'll need TCL as well, since EXPECT is based on TCL. Both are valuable tools, and many UNIX sites are using the Tk / TCL toolkit for rapid development of Xwindows software. Portions of CiscoWorks seem to be based on Tk, so this is high-quality freeware.
EXPECT is a marvelous tool for writing scripts to drive other programs. It recognizes prompts and sends keystrokes in response. It was written by Don Libes of NIST, and you can find papers on it in Usenix LISA (Large Systems Administration) conference proceedings, as well as on the Internet.
You don't even have to write your own EXPECT scripts to manage routers. There is a set by Matt Crawford of FERMILAB, available from Cisco's ftp.cisco.com. They're in pub/cisco-expect.shar.
Break out the three small scripts (each is about 1/2 page long when printed) and you've got a basic toolkit. The scripts are named ciscoexec and ciscoconfig, with ciscologin.expect for loading router names and passwords from a file. The ciscoexec script lets you feed EXEC commands to routers via telnet. The ciscoconfig script configures routers. Both take sequences of commands in quotes, separated by semicolons, on the command line. Having the router passwords in a UNIX file is of course a security issue. One possibility is to keep this toolkit under lock and key (chmod the directory, etc.) for occasional use only.
The scripts did need some tweaking to work with recent versions of EXPECT. Syntax seems to have changed mildly. I don't want lots of people bothering Matt, so I shortened the names (most of my stuff passes through DOS at one time or another). I added the line
set argv [ concat "cisexec" $argv ]as the first line of the script (argv[0] seems to have been left out), and I added quotes to the send lines at the end, as in
send "terminal length 0\r"Put "debug 1" at the start of the script and it will tell you what it's doing, in copious detail.
It may be some initial fiddling to get this to work, but it gives you a fallback tool if you ever should need it (for example, someone goofs and uses CiscoWorks to turn off SNMP in all your routers).
As far as Operating System, UNIX seems to be where it's at. There's the minor issue of administering the system -- no problem if you can get another group in the company to do it (and not dictate to you). MS Windows will handle small networks, perhaps actively managing a few tens of devices. I hear rumors of various network management products coming for Windows NT. We'll have to see if Windows NT really has enough horsepower.
So let's assume you've got some SNMP package and are wondering what to do with it. Some people almost seem to feel guilty about not collecting every SNMP variable from every device on their network. If it makes you feel any better: you probably can't do that, unless you have management station CPU cycles and bandwidth to burn. It's more important to have just enough polling to watch whether interfaces are up or down, and to watch a few key variables such as line utilization, CPU load, and other items of importance in your business.
access-list 60 permit a.b.c.d 0.0.0.0It's best to restrict SNMP access to network management stations, and a simple access list is used for this. This remains vulnerable to source address spoofing, but is better than nothing.
access-list 60 permit e.f.g.h 0.0.0.0
access-list 60 deny 0.0.0.0 255.255.255.255
snmp-server community password1 RO 60The SNMP community strings identify what a user can do, and also act as a password. If you don't mind anyone getting SNMP data from your routers, including your routing tables and ARP caches, make "password1" above "public", and leave off the access list number, 60, following the RO (read-only) community. If you're on the Internet, you may well feel this is giving away too much information, in which case you'll want a non-obvious password and probably the access list as well.
snmp-server community password2 RW 60
The RW (read-write) community string should be a different and well-chosen password that you don't tell many people about. It allows your routers to be reconfigured, so guard it well! I strongly recommend using the access list to reduce the window of exposure here.
snmp-server system-shutdownThis allows SNMP-triggered rebooting of the router. Turn this on if you're going to use CiscoWorks to download IOS images to routers. Otherwise, it's better to leave this feature turned off.
If you have an old IOS release on an AGS+, you may want to configure:
snmp-server chassis-id ZZZZOtherwise, this defaults to the chassis-id.
To avoid unpleasant interactions with large groups of SNMP variables and SunNet Manager, and to allow larger SNMP packets to be used, configure
snmp-server packetsize 4000Most people using SNMP want to receive SNMP traps, as early indications of trouble (with polling serving as backup in case the traps are lost). For each management station, configure:
snmp-server host a.b.c.dThis causes the router to send traps to host a.b.c.d.
There are two SNMP variables almost no-one seems to set. If you want to impress people with how well-managed your shop is, configure:
snmp-server contact XXXXFinally, if you wish to be paranoid (or careful) about people possibly trying to guess your SNMP community string (assuming they haven't snooped it off a wire somewhere), you can configure
snmp-server location YYYY
snmp-server trap-authenticationand the router will send traps when an invalid SNMP community string is used.
By the way, you can specify the traps' source address. This should not be necessary if all IP addresses for the router resolve to the same primary name. If you think in terms of the file, /etc/hosts, it should look something like:
a.b.c.d paris paris_s0That way, you can ping or telnet to a specific interface, but the addresses all resolve as "paris", the same name. In DNS terms, the PTR name should be consistent, use CNAME records for the aliases.
e.f.g.h paris paris_e0
A final suggestion: if you are counting on SNMP traps, it's wise to test them! There's several ways you can lose traps between your router and getting an icon to blink in your network management software. It's wise to make sure you didn't overlook anything.
One possible test is to "no shutdown" and later "shutdown" an unused interface on a router that is configured to send traps. Please don't accidentally do this to the one you've telnetted in by!
Dr. Peter J. Welcher (CCIE #1773, CCSI #94014) is a Senior Consultant with Chesapeake NetCraftsmen. NetCraftsmen is a high-end consulting firm and Cisco Premier Partner dedicated to quality consulting and knowledge transfer. NetCraftsmen has nine CCIE's, with expertise including large network high-availability routing/switching and design, VoIP, QoS, MPLS, network management, security, IP multicast, and other areas. See http://www.netcraftsmen.net for more information about NetCraftsmen. Pete's links start at http://www.netcraftsmen.net/welcher . New articles will be posted under the Articles link. Questions, suggestions for articles, etc. can be sent to pjw@netcraftsmen.net .