cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3912
Views
25
Helpful
9
Replies

VLAN subnet

is it possible to setup different VLAN with same subnet?if yes then how to configure different VLAN with same subnet mask??

9 Replies 9

Rolf Fischer
Level 9
Level 9

Sorry, I'm afraid I don't understand the question.

If you want to configure IP addresses belonging to the same IP subnet on diffent interfaces (SVIs in the case of VLANs) of the same device, they have to belong to different routing contexts (VRF [Lite]).

Example:

R2(config)#do show ip interface brief vlan1
Interface                  IP-Address      OK? Method Status                Protocol
Vlan1                      192.168.0.2     YES NVRAM  up                    up

R2(config)#int vlan 2
R2(config-if)#ip address 192.168.0.3 255.255.255.0
% 192.168.0.0 overlaps with Vlan1

R2(config-if)#do show ip interface brief vlan2
Interface                  IP-Address      OK? Method Status                Protocol
Vlan2                      unassigned      YES manual up                    up


R2(config)#ip vrf TEST
R2(config-vrf)#rd 1:1
R2(config-vrf)#int vlan 2
R2(config-if)#ip vrf forwarding TEST
R2(config-if)#ip address 192.168.0.3 255.255.255.0
R2(config-if)#do show ip interface brief vlan1
Interface                  IP-Address      OK? Method Status                Protocol
Vlan1                      192.168.0.2     YES NVRAM  up                    up
R2(config-if)#do show ip interface brief vlan2
Interface                  IP-Address      OK? Method Status                Protocol
Vlan2                      192.168.0.3     YES manual up                    up


Feel free to ask further!

HTH
Rolf

Rolf has supplied a very creative solution which meets the literal meaning of the requirement to have the same subnet in two different vlans. But I wonder if that is really what the original poster means in his question. When we talk about things in the same subnet that usually carries the assumption that devices in the same subnet should be able to communicate with each other directly. I wonder if that is what the original poster had in mind. Clarification about this would be helpful.

The solution suggested by Rolf creates the situation where the same subnet is in two different parts of the network. Logically it would be similar to a situation where router A has 192.168.0.0/24 on FA0/0 and is connected to router B on FA0/1. And where router B connected to router A on FA0/1 has 192.168.0.0/24 on its FA0/0. The result is that a device on Router A at 192.168.0.2 can not communicate with the device on router B at 192.168.0.3. We can do this but why would we want to do this?

The original question was not clear. Rolf has provided a solution that satisfies the requirement as stated. But we really need clarification about what the original poster is really trying to achieve.

HTH

Rick

HTH

Rick

my question was really not that complicated. I only wanted to no that is it possible to configure two VLAN in a same network say 192.168.123.0 having same subnet say 255.255.255.224 as for 25 host in each subnet.

Hello Sarthak,

As stated earlier by all it is possible but that will be only at L2 level , You cannot do routing of same subnet with different VLANs from one switch.

With L2 it will be inside a single switch where you won't be having SVI for that VLAN and you can communicate with charm.

But when it comes for l3 routing of subnet can only be possible with either of the VLANS which has SVI configured. Two VLANS with SVI on same subnet can create problem.

Hope it Helps..

-GI

thank you

If you mean "Is it possible to have two VLANs, one on say 192.168.123.0/27, and one on 192.168.123.32/27", then yes, it is perfectly possible because there is no overlap.

If you, mean "Is it possible to have two VLANs, one on 192.168.123.0/24 and the other on 192.168.123.32/27", then they overlap, so it would not be allowed.

(Well ... actually it can be done with a devious trick involving static routes and proxy arp ... but let us not go into that unless you absolutely need it.)

Kevin Dorrell

thank you Rolf this is very helpful for my scenario.

Thanks, I'm glad to hear this. However, please note that VLAN1 and VLAN2 in my example belong to different routing-contexts: VLAN2 is part of a virtual router which has its own routing-table and set of interfaces (Rick explained that in the 2nd paragraph of his post), whereas VLAN1 belongs to the global routing-context.

In the example I just wanted to show that a Cisco switch does not allow you to create overlapping IP networks on interfaces belonging to the same routing-context.

Ganesh Hariharan
VIP Alumni
VIP Alumni

Hello Sarthak,

Actually it all depends on your requirement, From layer 2 we do have two vlans in the same subnet. But from the perspective of layer 3 we will have a problem. we could  not be able to configure (on the same switch) interface vlan 10 with an address in the same common subnet that of interface vlan 20 which will also have same subnet. The switch would complain about overlapping addresses.

 So what you to achieve is the main question.

Hope it Helps..

-GI

Review Cisco Networking for a $25 gift card