You are on page 1of 3

2/16/2021 switch - Routing Between 2 different vlans but same subnet - Network Engineering Stack Exchange

Network Engineering Stack Exchange is a


question and answer site for network
engineers. It only takes a minute to sign
up.

Sign up to join this community

Anybody can ask a question

Anybody can answer

The best answers are voted


up and rise to the top

Routing Between 2 different vlans but same subnet


Asked 3 years, 3 months ago Active 2 months ago Viewed 5k times

I have a basic doubt understanding vlan communication.

2 Scenario: Let's say a single switch and has been configured with 2 vlans (vlan 100 and vlan 200).
Vlan 100 connects to lets say 192.168.100.0 network. And I have a host 1 connected to it with IP
address(192.168.100.2).

Question: Now for other vlan 200,if I again connect 192.168.100.0 network and connect a host 2
to it with IP address(192.168.100.3). Will I be able to ping between host 1 and host 2.

I do understand that we don't need to have two vlan if its the same subnet, but I am curious to
know how this would work. Also, to communicate between two vlan we can have router, for
example in this case the router(let's say the gateway 192.168.100.1). Will this setup work?

switch vlan subnet

Share Improve this question Follow asked Nov 3 '17 at 19:56


user8802482
23 1 3

2 Answers Active Oldest Votes


https://networkengineering.stackexchange.com/questions/45459/routing-between-2-different-vlans-but-same-subnet 1/3
2/16/2021 switch - Routing Between 2 different vlans but same subnet - Network Engineering Stack Exchange
2 Answers Active Oldest Votes

No, this would not work, each VLAN is a separate broadcast domain. Each VLAN has its own
MAC address table which the switch uses to forward traffic at L2 between the ports that are in the
4 same VLAN. Each VLAN also only contains the ports that are assigned to that VLAN.

Firstly the ARP from the PC in VLAN 100 would not be forwarded to the PC in VLAN 200
(separate broadcast domain), so the PC on 192.168.100.2 would not be able to resolve the MAC
address of the PC at 192.168.100.3

Secondly, even if you created a static ARP on the first PC for the second PC, VLAN 100 does not
contain the MAC address of the second PC.

If you tried to create a static MAC entry in the MAC table of VLAN 100 for the second PC you
could not as the port the second PC is connected to is not in VLAN 100.

In order to communicate between VLANs, you need to configure routing. This can be done on a
L3 switch or router. You would of course not be able to route between two networks with the
same network address (on the same router) as Cisco routers do not allow you to configure the

same network on two ports in the same VRF (Juniper routers may allow two interfaces on the
same network in the same VRF, but this is not the norm).

The only way to do this would be to physically connect a port from VLAN 100 into a port from
VLAN 200, to bridge the two VLANs together.

Of course, you would never do any of this in real life.

Share Improve this answer Follow answered Nov 3 '17 at 20:07


Karl Billington
4,550 6 26

"Of course, you would never do any of this in real life." - why not? I have a number of times connected two
individual VLANs with a physical connection using the same subnet. For example, to separate a section of
the subnet that accesses the rest through some sort of "transparent" device (L2 firewall, shaping, etc). –
YLearn ♦ Sep 29 '19 at 15:53

Agree, those are valid use cases if the intermediate device is interacting with the traffic, but connecting two
VLANs through an Ethernet cable for no other purpose than allowing the two to communicate is a bad
design practice – Karl Billington Oct 4 '19 at 6:19

Routing between different Vlans with same subnets is not feasible .

-1 Generally same subnet communication happen by default , not required any Vlans to be tagged .

Only different Vlans with different subnet are feasible to routing .

Share Improve this answer Follow answered Dec 10 '20 at 11:31


https://networkengineering.stackexchange.com/questions/45459/routing-between-2-different-vlans-but-same-subnet 2/3
2/16/2021 switch - Routing Between 2 different vlans but same subnet - Network Engineering Stack Exchange
Share Improve this answer Follow answered Dec 10 20 at 11:31
Sagar Uragonda
2,480 1 1 19

https://networkengineering.stackexchange.com/questions/45459/routing-between-2-different-vlans-but-same-subnet 3/3

You might also like