Good afternoon/evening,

Today on my Cisco Packet Tracer, I made two layer 2 switches and 2 PCs on each switch. I created a vlan 10 on the switches. I trunked the switches together so they can see the vlans.

Switch 1 has a PC in vlan 10 with

Switch 2 has a PC in vlan 10 with

I plugged in 3 routers.

How do I configure a router so a PC in vlan 10 on one subnet in a switch can access another PC in vlan 10 with different subnet in another switch?

  • Little diagram would help to understand what you have now and what you want to achieve. Also please attach network devices configurations to your original post. Sep 6, 2019 at 9:14
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 15, 2019 at 18:47

2 Answers 2


Welcome to Network Engineering! We hope you will become a contributing member of this community.

Generally speaking, having multiple subnets on a single VLAN is not a good idea. Usually you have one subnet per VLAN (and vice versa). There are exceptions, but this is a general good practice.

In your case, you need to configure a secondary address on your router. The primary address is on one subnet; the secondary address is on the other.

Be aware that some routers do not operate the same with secondary addresses as they do for primary. Some features or services may not be available. This is another reason to avoid secondary addresses if possible.


Normally, you put nodes from different IP subnets in different VLANs (L2 segments). In any case, different subnets require a router for communication. The router needs to be attached to each VLAN - since you've only got one, it'll just use a single interface.

In your case, the router needs to be configured with multiple IP addresses on the single interface, one address for each subnet. It may also require explicit configuration to route back to the ingress interface (router-on-a-stick).

The router addresses need to be set as gateways, e.g. for, and for

For efficiency, you should attach the router to the switch that is likely to carry more routed traffic. (It'd be very inefficient to receive a packet on switch 1, forward it to switch 2, forward to the router, and all the way back to switch 1.)

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.