Networking

Three ways to remotely determine your Cisco router's serial number

Inventorying your routers' serial numbers is an important activity that every network administrator needs to be able to do -- both to keep track of what you have and to properly register for support and maintenance from Cisco Systems. How do you collect these numbers without physically going to each and every router in your organization? Here's how to determine those serial numbers remotely.

At some point, it's a good idea to conduct a router inventory to determine which routers you have as well as their models, RAM, Flash, IOS versions, and serial numbers. I mention the serial number specifically because you need it to both track your routers and to register for a Cisco SMARTnet service contract.

How do you collect these numbers without physically going to each and every router in your organization? Here's how to determine those serial numbers remotely.

Issues to consider

One challenge with determining the serial number of your router is that there are so many different serial numbers -- the processor board ID, serial numbers on every interface card, the chassis serial number, and many others.

In some cases, you may even find that none of the serial numbers that you find by connecting to the router actually match the serial number on the sticker on the outside of the router. In addition, the results that you get will vary from router platform to router platform.

On newer routers such as the Cisco 2800 Series and 3800 Series, the serial number on the outside of the router, the processor ID, and the hardware chassis serial number are all the same. Even better, you can access this unique number via Telnet, SSH, or SNMP.

On the other hand, older routers make things more confusing. For example, if you have a Cisco 2500 Series router, you can't find the number on the sticker on the outside of the router by connecting to the device over the network. In fact, I opened up a Cisco TAC case, and they told me this was "by design."

One workaround to this issue is to manually enter the physical serial number from the outside of the router into the configuration of the router. That way, you can access it via SNMP.

You can manually set the chassis serial number using the following command:

snmp-server chassis-id

For more information, check out "How To Collect Chassis Information (including the Chassis Serial Number) For Routers And Catalyst Switches Using SNMP" on Cisco's Web site.

How do I find the serial numbers?

Here are three options for remotely retrieving serial numbers over the network. These solutions assume that you have a newer router in which the output of the serial number from the IOS matches the physical router serial number, that you have programmed the serial number into the IOS, or that you are comfortable using the serial number that the IOS provides.

Due to the varied number of routers and the varied functionality in the router IOS between versions and router models, I can't guarantee that the following steps will work on your router or in your IOS. While I have searched for a slick, easy method to retrieve router serial numbers across all router models and IOS versions, I haven't come across a solution yet.

Option 1: Telnet or SSH

The easiest way to retrieve the serial numbers from your router is to Telnet or SSH to the router and use the show inventory command. Here's a sample of the output:
Router# show inventory

NAME: "3845 chassis", DESCR: "3845 chassis, Hw Serial#: FBX0943A51E, Hw Revision: 1.0" PID: CISCO3845 , VID: V01 , SN: FCC01235BXN

NAME: "c3845 Motherboard with Gigabit Ethernet", DESCR: "c3845 Motherboard with Gigabit Ethernet" PID: CISCO3845-MB , VID: V02 , SN: FSC0921215M

NAME: "Clear/Subrate T3/E3 WAN", DESCR: "Clear/Subrate T3/E3 WAN" PID: , VID: 1.0, SN: FVC09234ABM

The chassis hw serial# section designates the serial number that is physically on the router.

Option 2: Use SNMP from the command line

You can retrieve the same chassis hardware serial number from the command line using simple network management protocol (SNMP). I did this in Windows XP by downloading two free utilities, using a text file as my source list of routers, and writing a short windows .bat file to process it for me. (If you have Linux, you should already have the snmp-get command and awk command available.)

To begin, download the Net-SNMP tools so you can use the snmpget command. You can use this tool to get the chassis hw serial# information from a single router with a single command. Here's an example:

snmpget -v1 -c communitystring hostorIP mib-2.47.1.1.1.1.11.1

The output looks like this:

SNMPv2-SMI::mib-2.47.1.1.1.1.11.1 = STRING: "FDC01235PAN"

If you want to write a batch file to automate the process, follow these steps:

  1. Download Gawk for Windows (awk) to parse the output from the snmpget command.
  2. Install both tools in the same directory.
  3. Create a text file that lists the router hostnames or IP addresses; name it Routers.txt.
  4. Put the following in a batch file (I called mine Getsnscript.tx) and run it:

@echo off
for /F %%1 in ('type routers.txt') do snmpget -v1 -c cisco %%1 mib-2.47.1.1.1.1.11.1 | awk -F" " "{ print $4 }"

The output might look something like this:

C:netsnmpbin> getsnscript.bat

"FO234C35PXN"

"FTX093431P1"

"FO234C35PXN"

If you want, you can redirect it to a text file and import that text file to a spreadsheet. Of course, you can also get much more complex with the script and retrieve more information.

For more information on the SNMP string I used, check out the Cisco's Unique Device Identifier Retrieval Web page.

Option 3: Use SNMP from a GUI application

Of course, there are always GUI applications that can accomplish the same thing as CLI scripts. I've found that Kiwi CatTools (freeware for up to five devices) does a fine job of retrieving the serial number of routers and provides a nice inventory. Figure A offers a snapshot of the Kiwi CatTools output.

Figure A

Figure A

In addition, I checked with PacketTrap, and its pt360 Tool Suite will begin supporting this feature in the next release. Perhaps there are other applications out there that you've used before. If so, please share them in the discussion area.

Another thought I had was to write a TCL script to retrieve serial numbers. However, since I'm not a TCL programmer, this probably isn't the best option for me.

Conclusion

If your routers are newer and the results of the show inventory command are accurate, you should be able to easily retrieve your router's proper chassis serial number remotely over the network. However, with older models, you may have to first manually enter the router serial number into the IOS to be able to remotely retrieve it.

Inventorying your routers' serial numbers is an important activity that every network administrator needs to be able to do -- both to keep track of what you have and to properly register for support and maintenance from Cisco Systems.

Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!

16 comments
mkupper
mkupper

When you do "ip http secure-server" and you don't have a a certificate already set up IOS will automatically generate a new certificate named "TP-self-signed-####" where #### is reported to be the router's serial number.[1] This is always a decimal number and is not the same as as the Chassis Serial Number number displayed by "show diag" or "show inventory." As far as I know - the only way way to discover this number is to config "ip http secure-server" and then to exec either "show crypto pki trustpoints" or "show crypto pki certificates." It's then included in the startup-configuration. The number seems to be stable (never changing for a particular router) and seems to be unique. It does not seem to correspond with either the Chassis Serial Number nor the PCB Serial Number. The number seems to be a 32-bit value or at least I've never seen one that's would need 33 or more bits. [1] See one of the "Persistent Self-Signed Certificates" articles on cisco.com such as http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gtpsscer.html which says "The number 3326000105 above is the router's serial number and varies depending on the router's actual serial number. "

richard.ratcliffe
richard.ratcliffe

A better way... 1. In older Cisco IOS versions nothing will show you the serial number stamped on the outside of the device. A way to get around this is to enter in your configuration the following command: ! snmp-server chassis-id YourRouterSerialNumber Example: snmp-server chassis-id FKH070913SN 2. To veiw this information remotely there are serveral ways to see this info... the following commands can be used: show conf show run | include chassis-id show snmp I like "show snmp" the best which displays: router#sho snmp Chassis: FKH070913SN 121760 SNMP packets input 0 Bad SNMP version errors 0 Unknown community name.....etc 3. To do this from a Linux box do what it says in option 2 except enter this command: snmpwalk -v1 -c CommStrg HostOrIP .1.3.6.1.4.1.9.3.6.3 The result will look something like this: SNMPv2-SMI::enterprises.9.3.6.3.0 = STRING: "FKH070913SN"

JPru22
JPru22

I have had to manually enter the serial number on my 2600 routers, but I have a WS-C2948 switch that is not reporting the correct serial number. Is there a way to manually enter the serial number in that type of device. It is running CAT OS.

fday
fday

Thanks for all your tips. I always look forward to the Routers and Switches newsletter and have used many of your tips and recommended tools.

bart.thoen
bart.thoen

I usually use "sh diag" which tells me also the serials of the modules onboard

blayne
blayne

'show ver' also works well with current code.

ddavis
ddavis

What did you think of this article? Did you find these tips helpful? Do you have any better ways to remotely inventory your router & switch serial numbers?

FAST!!!
FAST!!!

show ver is what I normally use as well

richard.ratcliffe
richard.ratcliffe

I have older Cisco routers where the serial number of the unit does not show up in any command entry (such as show ver, show inventory, etc.) The snmpget command works to give me the same incorrect serial number I am not looking for. It does not retrieve an snmp-server chassis-id ##### entry. So I am back where I started from...not getting the true serial number tagged on the outside of the unit.

johnwcannon
johnwcannon

Once you have your community setup, Cisco Network Assistant can help inventory your devices as well. Open up CNA, go to Monitor, then Reports, then Inventory. All your devices are listed with their S/N. It is nice because it tells you what the device type is. The disadvantage is the work required to export to Excel. You can print the report to PDF, then copy and paste the text into Excel.

tmcleod
tmcleod

I just wanted to thank you for all your past articles and examples, they have been very helpful to me, and are very clearly written. When I get the Tech Republic e-mail on Friday's I know I'm going to learn something. Thank you and keep up the good info.

wilsonb
wilsonb

So i guess the only way to get the SN from the 26xx series is to go to the router and read the sticker.. o well i guess we only have about 20 of them so it shouldnt be too bad. You could also just use the sh snmp command for most other models. As long as the chasis-id command isnt set it will show the vaule for the serial number

amin.mohammed
amin.mohammed

I wanted find out is there a way to determine the age various Cisco equipment?

sjamieson
sjamieson

you can copy and paste from CNA to excel, but only one line at a time. I can only export from CNA to .prn files and would have to get ghostscript to view the prn files.

career
career

Here is the command to get the Serial number from any Catalyst switch: snmpwalk -c -v 1 .1.3.6.1.4.1.9.5.1.2.19 For example: snmpwalk -c public -v 1 myswitch.example.net .1.3.6.1.4.1.9.5.1.2.19 SNMPv2-SMI::enterprises.9.5.1.2.19.0 = STRING: "SAL123456789"

Editor's Picks