How can I tell on a swtich if im on L2 or L3

Answered Question
Jun 17th, 2009
User Badges:

I have a couple of 3550,2950,6509,4507 and trying to find out if they are running L2 or L3



Attachment: 
Correct Answer by Jon Marshall about 8 years 1 month ago

When you configure a device with an "ip default-gateway" you are telling the device to forward all traffic to that gateway. The device itself is not routing, it merely sends all packets to the default-gateway. This is like a desktop PC that has a default-gateway. It sends all it's traffic that is destined for a different subnet to that default-gateway.


A L2 switch or a L3 switch that is only acting as a L2 switch usually has one L3 vlan interface. This interface is not for forwarding client data traffic. It is used to remotely manage the switch. So you can telnet to the L3 vlan interface on the switch. But without a default-gateway on the switch you would not be able to telnet from a different subnet.


A default-route is doing the same thing but in a different way. A default-route again tells the device to send all traffic to the next-hop for any remote subnet. So in that way it is acting in the same way as the default-gateway. But you use a default-route on a device when it makes routing decisions. Sometimes the only route a device has is the default-route but often it has other routes as well. Client PC's generally do not have default-routes.


So you can see a switch with a single L3 vlan interface with a default-route is technically acting as L3 switch ie. it is routing even though it is very similiar to a L2 switch with an ip default-gateway. Like i say, more often than not a switch acting as a L3 switch will have multiple L3 vlan interface and a bigger routing table but as your example shows it doesn't have to.


Jon

Correct Answer by Jon Marshall about 8 years 1 month ago

default-gateway is used on a L2 switch.

default route is used on a L3 switch.


No idea why it was set up this way. If you only have one L3 vlan interface as you do on the config you supplied i would assume it is L2 only.


Generally -


3550/3560/3750 can be either L2 or L3

4500 - more will probably be L3 than L2 but they can be L2

6500 - even more will be L3 than L2


That is just a rough guideline.


Jon

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (4 ratings)
Loading.
alfredgarcia506 Wed, 06/17/2009 - 13:38
User Badges:

I have about 40 switches I inherited and need to get a clear picture of which switches are running L3 and which switches are running L2 and what to find out if their is an easy or shortcut method.

Jon Marshall Wed, 06/17/2009 - 13:41
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

You can also use the command "sh ip route"


If the switch is L3 you should get routes back. If the switch is L2 it will simply come back with the default-gateway.


Jon

Jon Marshall Wed, 06/17/2009 - 13:26
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

2950 is L2 only.


All others can be run as L3 or L2.


Check for "ip routing" command in you config. The attached 3560 config looks like it is running L2 only although both an "ip default-gateway" and a default-route have been configured.


If you have multiple vlan interfaces then there is a good chance it is running as L3.


Jon

alfredgarcia506 Wed, 06/17/2009 - 13:41
User Badges:

I inherited about 40 switches and I'm trying to weed my way through the configs. What would a ip default-gateway vs a default-route do for this config? Why do you think they setup this way. So is this L2 or L3 final answer?

Correct Answer
Jon Marshall Wed, 06/17/2009 - 13:44
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

default-gateway is used on a L2 switch.

default route is used on a L3 switch.


No idea why it was set up this way. If you only have one L3 vlan interface as you do on the config you supplied i would assume it is L2 only.


Generally -


3550/3560/3750 can be either L2 or L3

4500 - more will probably be L3 than L2 but they can be L2

6500 - even more will be L3 than L2


That is just a rough guideline.


Jon

alfredgarcia506 Wed, 06/17/2009 - 13:53
User Badges:

Thank you so much Jon. I have one final question and have attached the following from another switch : Question is if this switch running L3 do to it reponse??

DPSSSWCITD0102#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is 10.67.8.1 to network 0.0.0.0


10.0.0.0/24 is subnetted, 1 subnets

C 10.67.8.0 is directly connected, Vlan1

S* 0.0.0.0/0 [1/0] via 10.67.8.1

DPSSSWCITD0102#

Jon Marshall Wed, 06/17/2009 - 13:55
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Can you post config of switch ?


Jon

Jon Marshall Wed, 06/17/2009 - 14:11
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Okay, technically this is acting as a L3 switch but it actually has only one L3 vlan interface (vlan 1) so it is not doing any inter-vlan routing.


There is no "ip default-gateway" configured only a default route. So "ip routing" is enabled as far as i can tell and it routes packets to it's default-route.


So it really depends what you mean when you say L2 or L3 switch. To me a switch acting as a L2 switch is one that does not have "ip routing" enabled, either because it is L2 only or because L3 has been disabled, or not enabled depending on the default setting.


A switch acting as a L3 switch has ip routing enabled.


Is this config from a a 6500 or 4500 ?


Jon

alfredgarcia506 Wed, 06/17/2009 - 14:19
User Badges:

It's a 4500 with 158GigE/4 tenGigE. What is the difference between Ip default-gateway configured vs a defalut route config?

Correct Answer
Jon Marshall Wed, 06/17/2009 - 14:29
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

When you configure a device with an "ip default-gateway" you are telling the device to forward all traffic to that gateway. The device itself is not routing, it merely sends all packets to the default-gateway. This is like a desktop PC that has a default-gateway. It sends all it's traffic that is destined for a different subnet to that default-gateway.


A L2 switch or a L3 switch that is only acting as a L2 switch usually has one L3 vlan interface. This interface is not for forwarding client data traffic. It is used to remotely manage the switch. So you can telnet to the L3 vlan interface on the switch. But without a default-gateway on the switch you would not be able to telnet from a different subnet.


A default-route is doing the same thing but in a different way. A default-route again tells the device to send all traffic to the next-hop for any remote subnet. So in that way it is acting in the same way as the default-gateway. But you use a default-route on a device when it makes routing decisions. Sometimes the only route a device has is the default-route but often it has other routes as well. Client PC's generally do not have default-routes.


So you can see a switch with a single L3 vlan interface with a default-route is technically acting as L3 switch ie. it is routing even though it is very similiar to a L2 switch with an ip default-gateway. Like i say, more often than not a switch acting as a L3 switch will have multiple L3 vlan interface and a bigger routing table but as your example shows it doesn't have to.


Jon

Actions

This Discussion