1

The configuration I want to achieve is for learning reasons, in Cisco packet tracer, not a real-life scenario:

I have one router and two switches connected to them. Each switch has multiple computers connected to them, some of which are in one VLAN, some are in another VLAN. If I understand correctly, computers in the same VLAN should also be in the same subnetwork, but this is unachievable, because trying this configuration results in an error (on the router):

interface g0/0.5  
 encapsulation dot1q 5  
 ip address [ip of vlan 5] 255.255.255.0  
interface g0/0.10  
 encapsulation dot1q 10  
 ip address [ip of vlan 10] 255.255.255.0

Then I did this for g0/1 interface, too, which resulted in an error. Is what I'm trying to do possible at all? If yes, what did I do wrong and how do I fix it (besides putting the computers of VLAN 5 under switch 1 and putting the computers of VLAN 10 under switch two)?

1 Answer 1

2

Routers route between networks, so each router interface, physical or virtual, must be in a different network. If you are connecting each switch to a different router interface, then you can use the same VLAN numbers, but they are not the same VLANs, and they cannot use the same networks.

VLANs are layer-2 broadcast domains, and they are bounded by a layer-3 device, e.g. router. Your VLANs cannot extend across a router. To have the same VLANs on both switches requires that the switches be connected together, and that you trunk between the switches.

How, for instance, would the router decide which of multiple interface with the same network to send a packet destined for that network? A router's routing table tells it which interface to use for traffic destined to a particular network.

1
  • So in short, I can't do this unless I connect the switches. Thanks. EDIT: You got an upvote, but it's invisible since my reputation is too low, I just registered.
    – sisisisi
    Commented May 16, 2017 at 9:41

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.