Is it possible to have interVLAN routing with router on a stick topology, but with remote sites communicating via OSPF? In the diagram below, I can ping PC1 from PC0. What I want is to ping PC2 and PC3 from PC0 with OSPF.

I can manage this with writing static routes but no chance with OSPF. Adjacency is set up but routers can not learn other's VLANs.

What would be the problem?

Thanks in advance, enter image description here

2 Answers 2


No. You cannot have the same subnet on different VLANs.

Consider the router on the left receives a packet for Does it forward to the subnet on the left, or the subnet on the right?

You can change the subnets on one side to and, for example.

BTW, your question really has nothing to do with OSPF or any other routing protocol.

  • Dear Mr. Trunk, thank you for your reply. If I change the subnets on one side as you proposed, wouldn't I have 4 VLANs instead of 2? I can only have 2 VLANs in the project, let's say. My solution is to subnet these 2 networks with /25 mask so that I can stay in the same IP block without increasing the VLAN number. VLAN10 PC0 - VLAN20 PC1 - VLAN10 PC2 - VLAN20 PC3 - Do you think it is logical? I am a beginner, sorry if I express myself not in a correct way.
    – D.D
    Commented Mar 3, 2022 at 5:52
  • 1
    If I change the subnets on one side as you proposed, wouldn't I have 4 VLANs instead of 2? You already have four VLANs. The VLAN tag is only meaningful to the switch and stops at a layer 3 device. So VLAN 10 on the left is different than VLAN 10 on the right. You can use any subnets you want as long as they are unique.
    – Ron Trunk
    Commented Mar 3, 2022 at 13:13
  • I realized your point just after I posted my comment. Thank you so much!
    – D.D
    Commented Mar 3, 2022 at 14:27
  • 1
    Please consider accepting my answer so it doesn't keep popping up in the list.
    – Ron Trunk
    Commented Mar 4, 2022 at 14:05

The short answer is NO you cannot do this and should re-address the overlap.

The longer answer is that this can be done, but requires some very tricky bi-directional NAT rules looking at both source and destination addressing. These sorts of issues do crop up when merging 2 large companies in the real world. HOWEVER, you aren't going to be able to do any of these advanced NAT things with packet tracer. It's better to follow "shorter" answer and just re address the network.

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.