06-23-2010 04:07 AM - edited 03-06-2019 11:42 AM
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.
06-23-2010 04:15 AM
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:
Rate for helpful replies......!!!
Regards,
06-23-2010 04:36 AM
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
06-24-2010 12:50 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide