I have two switches (A,B) connected to each other and one of them is connected to a router with the interfaces

g0/1.1 vlan10
g0/1.2 vlan20
g0/1.99 native

switch A has vlan 10 ( switch B has vlan 20 (

vlan10 has a laptop with the ip address and needs to ping the server in the vlan 20 with the ip address but the icmp packet is dropped when reaching the first switch

I made sure that the connections between the switches and router are trunk and that the native vlan is 99, I also did make sure that the vlans are defined using the command show vlan brief, and made sure that I defined the vlan interfaces with the correct ip and netmask using the command interface vlan <number> followed by ip address <gateway> <netmask> but for some reason that i can't figure out, the ICMP traffic from the laptop is dropped on switch A and same for the server on vlan 20.

How can I troubleshoot such problem?

  • Did you actually create the VLANs with the global vlan <number> command on both switches? Simply creating the SVI with the with the interface vlan <number> is not enough.
    – Ron Maupin
    Commented Sep 1, 2023 at 21:18
  • i did create the vlans with the command vlan <number> and i verified that using the command show vlan brief
    – nirvana
    Commented Sep 1, 2023 at 21:22
  • Please post all 3 configuration files (or at least the relevant parts of them) so we can sort this out.
    – Elias Bats
    Commented Sep 2, 2023 at 11:49

2 Answers 2


switch A has vlan 10 ( switch B has vlan 20 (

At least one of the switches needs to have an interface in each VLAN. In your question it sounds like each switch has just got a single interface, so none of them is able to route between VLANs.

And if course, routing might need to be turned on (ip routing) if it isn't by default.

[From comment]: Catalyst 2960 switches are layer 2 only. They can't forward/route between VLANs. You will need to trunk the VLANs to the router and configure subinterfaces there for routing.

  • I get the error message % Invalid input detected at '^' marker. suggesting ip routing isn't valid for 2960 switches, and do i need to create vlan interfaces on all switches using the command interface vlan <number>
    – nirvana
    Commented Sep 1, 2023 at 22:00
  • can you provide an official link on where this is stated
    – nirvana
    Commented Sep 1, 2023 at 22:16
  • @nirvana You only need to create SVIs on the switches that you want to route between VLANs. See the linked datasheets above.
    – Zac67
    Commented Sep 2, 2023 at 4:38
  • 1
    if the switches are L2 then the routing will have to be done in the router.
    – Elias Bats
    Commented Sep 2, 2023 at 11:48

As per https://networklessons.com/cisco/ccna-routing-switching-icnd1-100-105/how-to-configure-router-on-a-stick

You need to create encapsulation dot1q to perform router-on-stick or intervlan routing on your router. After that you can ping between different VLAN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.