Showing results for 
Search instead for 
Did you mean: 

Layer3 Switch or a Router

First of all I would like to thank everyone for the assistance.

I have been tasked with an inventory assignment for several sites.  Inventroy will be done remotely so no physical access to the devices.   The way the database is setup is with 3 device fields: Layer 2 switch, Layer 3 Switch and Router.  The discussion in the shop is how to determine a Layer 3 switch from a router or Layer 2 switch.

We remotely pull  several show commands from the switches, but we are unable to determine how to classify the devices.  Does anyone have any suggestions on how to classify between the three classifications. 

So far the only way we are determining this by looking at the show vtp and show ip route.  If the device accepts the show vtp command then its classified as a switch, if the device then has a routing protocol running, (static routes count) then its then considered a Layer 3 switch.

Any suggestions?


Also were trying to make this a automated process within a sql program.


If it's a valid assumption that the universe of devices actuallly polled is not unmanageably large, one could simply "show inventory" and parse out the model and build a table of all installed models. Then define device types a,b,c etc as L2 or L3 switch (depending on configuration as you noted already) and device types x, y, z as routers.

Hope this helps.


That was brought up at one point.  The two issues we have with that is:

a) We support many customers (DoD) so the universe of devices is actually unmanageably large.

b)  We have decided that if for instances a 6500 that is not doing any routing capabilites would be considered a layer 2 switch.  The other issue with this one is like the 6500s they can have SUP720 just as well as a 7600 series can have a sup720.

So classification would not be able to be done by model or chassis. It must be done by the function of the device not the model.


Ah, I see. When you said "several sites" is was mistaken in thinking that meant a relatively small number. Given that organizational context, I'm sensing some arbitrariness of classification. So one could argue (with merit) certain distinctions either way.

I'd fall back on Cisco's definitions. Look, for instance at the Cisco Product Quick Reference Guide. If they say a given device is a router, then who are we to argue?

You already have the logic that determines whether a switch is L2 or L3 (although personally I would submit that this distinction is cutting things a bit fine in the case of, as you cited, a 6500 series that is not currently configured with any routing since a small change to the running-config would change the classification).

Content for Community-Ad