Well, some days ago I had a interview for a IT networking job.

One of the questions was about switching, and says the following:

We have a computer A connected to a switch configured in VLAN2, and computer B connected to other switch configured with VLAN3. Considering the link between switches as access mode, has the computers A and B connection trough ping?


As I think the answer is NO, because if we are using dot1Q we need at least one router to join different VLANs (VLAN2 VLAN3). Am I wrong?

5 Answers 5


In this case, you are wrong. Since the link between the two switches is an access port, there is no VLAN tagging involved.

Think of it this way, switch two is a unconfigured switch (i.e. operating like a dumb switch) so all ports are in VLAN 1. This would still provide connectivity as well.

  • 1
    YLearn is correct. On an access port, the switch strips the VLAN tag from the frame when it sends it out and applies a VLAN tag to a frame when it comes into the switch. On a trunk port, the switch leaves the VLAN tag intact. Since you have the interswitch link labeled as access ports on both ends, the VLAN tags are not traversing the link, so the left switch will put incoming frames in VLAN 2 and the right switch will put incoming frames in VLAN 3, effectively putting the workstations in the same VLAN. Commented Jun 22, 2014 at 4:23

Your answer of NO would be correct if the hosts were in different IP subnets as then they would rely on inter-vlan routing to communicate with each other.

First question I would have asked was... Are they in the same IP subnet.

In a flat topology with access mode ports and all hosts in the same broadcast network the two hosts WOULD be able to talk to each other as the VLAN is local to the switch. No tagging would be carried across the link connecting the two switches due to the access port configuration. The frame would simply be passed along to the interested port or flooded to all ports in that vlan except the one it was received on if the destination mac address is unknown. Remember the tag is only passed along in a frame when it traverses a trunked port\interface.

So in this scenario:

  1. Let's assume the MAC tables are populated on both switches so we don't need to flood frames here
  2. Host on vlan 3 sends frame to host on vlan 2.
  3. vlan 3 switch receives, inspects destination mac and sends frame out of it's vlan 3 access port across to vlan 2 access port of opposite switch as the MAC table directs.
  4. vlan 2 switch inspects destination mac and looks up mac table which directs to vlan 2 port of host.


  • Good point. However based on my interview experience, when a place has a "test" with questions like these, if the question only involves L2, answer it as such. Seems to me the point of the question is to try to see if a candidate understands how VLANs interoperate between switches and not L3 routing. So you would probably get "bonus points" for bringing in L3, but only if you hit the main answer.
    – YLearn
    Commented Jun 22, 2014 at 13:54
  • Yeah there are many sides to interview experience. There is no right answer to that as some interviewers maybe looking at your ability to ask the right questions and score your troubleshooting prowess in conjunction with your knowledge of the theory.
    – moogzy
    Commented Jun 23, 2014 at 3:56

Since there is no Trunk/Tagged ports between the switches there will not be any concept of VLAN that will come between the switches..But the hosts to communicate with each other which are located in two different switches both should be configured with same Network/subnet mask address... But this concept wont apply two PC's with IP address with same network address/SUBnet mask but configured with different VLan's,in this case the Two PC's wont communicate with each other,,,because the VLAN information will come into effective if it's local to the switch..During this time the switch will use its VLAN database to check which are ports configured for each VLAN, based on that it allow or restrict the communications between the Hosts with in the same switch..


The fact that the question said both computers are in different VLAN, which mean it is talking about two different subnet, since VLAN = SUBNET, BROADCAST DOMAIN, NETWORK, then it is not possible for those computers to comunicate, without the presence of a layer three device(router).

  • a DOT1Q tag does not dictate the logical addressing. It is an indicator but might not hold true in some scenarios...
    – kaisero
    Commented Oct 12, 2015 at 15:55
  • VLAN = SUBNET is simply a false statement, especially since this also indicates that SUBNET = VLAN. It is possible to use the same subnet with multiple VLANs (or no VLAN), and it is also possible to use multiple subnets (or no subnet) with a single VLAN.
    – YLearn
    Commented Jun 16, 2018 at 18:51

Between two vlans we need to use intervlan routing to communicate each other. We have to enable trunk.

  • Welcome to NE, we hope you will both contribute to and learn from this community. However, VLANs only exist as configured on a single switch (for consistency we typically configure the same set of VLANs on every switch). Two switches using two different VLANs that have an access port connecting the two are sharing the same L2 domain. No routing is required.
    – YLearn
    Commented Aug 28, 2019 at 6:58

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.