Layer 2 and Layer 3

Unanswered Question
Jun 23rd, 2010
User Badges:

Hi,

I would like to know that is there any command that we can use in the Cisco switch in order to check whether a switch port is either a Layer 2 or Layer 3 port?

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Muhammad Zeesha... Wed, 06/23/2010 - 04:36
User Badges:

Hi,


You can use the command Show interfaces  [interface] switchport. If the port is routed (Layer 3) mode then the  command output will be as follows


SWITCH#show interfaces gigabitEthernet 4/1  switchport
Name: Gi4/1
Switchport: Disabled


If  the port is a Layer 2 port then command output will be as follows


SWITCH#  show interfaces  gigabitEthernet 3/7 switchport

Name: Gi3/7
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: On
Access Mode VLAN: 310 (Test_Vlan)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL


Unknown unicast  blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none



Hope  this helps, Please rate helpful posts


Thanks  & Regards


Zeeshan Sanaullah

Dipesh Patel Wed, 06/23/2010 - 04:15
User Badges:

Dear Lim Seow Hua,



 You can check using :

show interface fastethernet 0/2 switchport command.

If output shows Switchport: Enabled than it show that port is Layer 2 else it is Layer 3 port.

Example:

SW1#show interface fast 0/2 switchport
Name: Fa0/2
Switchport: Enabled
Administrative Mode: dynamic desirable
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none



Rate for helpful replies......!!!


Regards,

Ganesh Hariharan Thu, 06/24/2010 - 00:50
User Badges:
  • Purple, 4500 points or more
  • Community Spotlight Award,

    Member's Choice, February 2016

Hi,

I would like to know that is there any command that we can use in the Cisco switch in order to check whether a switch port is either a Layer 2 or Layer 3 port?

Thanks.


Hi,


If an interface is configured as switchport under interface then it is layer 2 as per the below example


interface GigabitEthernet0/12
switchport access vlan 40
duplex full
end


if you dont see switchport configuration under interface then it is layer 3 as per the below example

interface GigabitEthernet0/12

bandwidth 79872
ip address x.x.x.x x.x.x.x
ip accounting output-packets
ip ospf priority 0

duplex full
end


Hope to Help !!


Ganesh.H


Remember to rate the helpful post

Actions

This Discussion